Skip to content

Commit

Permalink
Added required epoc time field for Splunk HEC Event Receiver (#14246)
Browse files Browse the repository at this point in the history
Signed-off-by: Iain <[email protected]>
  • Loading branch information
digitalbadger-uk authored Aug 21, 2023
1 parent 3de8455 commit 8c7ab8f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions awx/main/utils/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ def format(self, record):
message.update(self.get_debug_fields(record))

if settings.LOG_AGGREGATOR_TYPE == 'splunk':
# splunk messages must have a top level "event" key
message = {'event': message}
# splunk messages must have a top level "event" key when using the /services/collector/event receiver.
# The event receiver wont scan an event for a timestamp field therefore a time field must also be supplied containing epoch timestamp
message = {'time': record.created, 'event': message}
return self.serialize(message)

0 comments on commit 8c7ab8f

Please sign in to comment.