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

Set default time #213

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Set default time #213

wants to merge 2 commits into from

Conversation

andrew-ie
Copy link

If the header or body serializers do not set the time in the header, then use the time data from the event.
This stops the events from just using the batch arrival time, which is effectively a useless time.

Andrew Craig added 2 commits November 9, 2021 16:08
If no header/body serializer provides time information, and the log event contains a time value,
then set that into the JSON header. This allows accurate logging of time information, rather than
just using the batch arrival time as the timestamp.
@@ -63,6 +63,10 @@ public String serialize(HttpEventCollectorEventInfo info) {
} else {
event.put("event", info);
}
if (!event.containsKey("time") && info.getTime() > 0) {

Choose a reason for hiding this comment

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

Maybe it is worth to create a separate method for that part one the time is not specified?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants