Skip to content

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.
} 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.

2 participants