Skip to content

Commit

Permalink
fixed HEC _time value
Browse files Browse the repository at this point in the history
  • Loading branch information
tomrade committed Oct 9, 2020
1 parent e95eda2 commit e915151
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/nom.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,11 @@ def send_to_hec(self,events):
# why does splunk HEC not support valid JSON lists for batching :( :( :(
batch_string = ""
for event in events:
batch_string = batch_string + json.dumps({'event' : event}) + '\n'
#print(self.parse_date(event['time']).timestamp())
batch_string = batch_string + json.dumps({'event' : event, "time": self.parse_date(event['time']).timestamp(), "sourcetype" : "evtxnom"}) + '\n'
#print(event)
r = requests.post(splunk_uri, data=batch_string, headers=headers, verify=False)
#print(r.text)
return r.status_code, r.text
def ingest_file(self,filename):
# Process 1 file ah ah ah
Expand Down

0 comments on commit e915151

Please sign in to comment.