Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added required epoc time field for Splunk HEC Event Receiver #14246

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

digitalbadger-uk
Copy link
Contributor

SUMMARY

This change adds an epoch time field to the json that will be sent when logging to Splunk. This time field is required as when sending to the Splunk HEC using the /services/collector/event receiver (which is why the "event" wrapper was added originally) no scanning of the event will occur to find the timestamp of the event. If a time for the event is required then either the time field needs to be set in the metadata or the parameter "auto_extract_timestamp=true" needs to be passed with the http request. Adding the itme field is the more efficient option. If neither of these options are set then Splunk uses the time that the event was received as the alert time, on busy HEC receivers when there is queuing this can distort the event times.

https://docs.splunk.com/Documentation/Splunk/9.1.0/Data/FormateventsforHTTPEventCollector
See event metadata section

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME

logging formatters

  • API
AWX VERSION
awx: 0.1.dev33401+g5def72b
ADDITIONAL INFORMATION

@fosterseth
Copy link
Member

with this change, does it work when auto_extract_timestamp set to both false and true?

@digitalbadger-uk
Copy link
Contributor Author

with this change, does it work when auto_extract_timestamp set to both false and true?

Hi
Yep, the new epoch time field is generated from the same underlying timestamp used to create the events @timestamp field so whichever gets matched by splunk it will be the same. To summarize the new time field will make auto_extract_timestamp redundant, but will not affect the matched timestamp of any message matched by Splunk.

Copy link
Member

@john-westcott-iv john-westcott-iv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. Needs integration test.

@thedoubl3j thedoubl3j removed their assignment Aug 9, 2023
@jay-steurer jay-steurer merged commit 8c7ab8f into ansible:devel Aug 21, 2023
13 checks passed
djyasin pushed a commit to djyasin/awx that referenced this pull request Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants