(payload)
Creates alerts for securitybot using data provided by Splunk.

    Args:
        payload (Dict[str, str]): A dictionary of parameters provided by Splunk.
Creates alerts for securitybot using data provided by Splunk.
Creates alerts for securitybot using data provided by Splunk .
def send_bot_alerts(payload):
    '''
    Creates alerts for securitybot using data provided by Splunk.

    Args:
        payload (Dict[str, str]): A dictionary of parameters provided by Splunk.
    '''
    # Generic things
    results_file = payload['results_file']
    alert_name = payload['search_name']
    splunk_url = payload['results_link']

    # Action specific things
    title = payload['configuration']['title']

    try:
        with gzip.open(results_file, 'rb') as alert_file:
            reader = csv.DictReader(alert_file)
            for row in reader:
                # TODO: eventually group by username and concat event_info
                create_securitybot_task(alert_name,
                                        row['hash'],
                                        row['ldap'],
                                        title,
                                        row['event_info'],
                                        splunk_url
                )

    except Exception:
        # Can't fix anything, so just re-raise and move on
        raise
def send_bot_alerts ( payload ) : # Generic things results_file = payload [ 'results_file' ] alert_name = payload [ 'search_name' ] splunk_url = payload [ 'results_link' ] # Action specific things title = payload [ 'configuration' ] [ 'title' ] try : with gzip . open ( results_file , 'rb' ) as alert_file : reader = csv . DictReader ( alert_file ) for row in reader : # TODO: eventually group by username and concat event_info create_securitybot_task ( alert_name , row [ 'hash' ] , row [ 'ldap' ] , title , row [ 'event_info' ] , splunk_url ) except Exception : # Can't fix anything, so just re-raise and move on raise