def _send_splunk(event, index_override=None, sourcetype_override=None):
 opts = _get_options()
 logging.info('Options: {0}'.format(json.dumps(opts)))
 http_event_collector_key = opts['token']
 http_event_collector_host = opts['indexer']
 splunk_event = http_event_collector(http_event_collector_key, http_event_collector_host)
 payload = {}
 if (index_override is None):
  payload.update({'index': opts['index']})
 else:
  payload.update({'index': index_override})
 if (sourcetype_override is None):
  payload.update({'sourcetype': opts['sourcetype']})
 else:
  payload.update({'index': sourcetype_override})
 payload.update({'event': event})
 logging.info('Payload: {0}'.format(json.dumps(payload)))
 splunk_event.sendEvent(payload)
 return True

def _send_splunk ( event , index_override = None , sourcetype_override = None ) : opts = _get_options ( ) logging . info ( 'Options: {0}' . format ( json . dumps ( opts ) ) ) http_event_collector_key = opts [ 'token' ] http_event_collector_host = opts [ 'indexer' ] splunk_event = http_event_collector ( http_event_collector_key , http_event_collector_host ) payload = { } if ( index_override is None ) : payload . update ( { 'index' : opts [ 'index' ] } ) else : payload . update ( { 'index' : index_override } ) if ( sourcetype_override is None ) : payload . update ( { 'sourcetype' : opts [ 'sourcetype' ] } ) else : payload . update ( { 'index' : sourcetype_override } ) payload . update ( { 'event' : event } ) logging . info ( 'Payload: {0}' . format ( json . dumps ( payload ) ) ) splunk_event . sendEvent ( payload ) return True
send the results to splunk .