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

Fix syslog year rollover issues caused by time zone differences. #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lazyallen
Copy link

I've noticed an issue: Graylog2/graylog2-server/issues/21472
RFC3164 syslog messages lack a year field. The syslog4j library attempts to add this, but its logic relies on the JVM's default timezone. This can lead to incorrect year appending during year rollovers if the JVM's timezone differs from the actual message's timezone.

For example, consider a message timestamped 2024-12-31T20:00:00-05:00 (EST), which is equivalent to 2025-01-01T01:00:00Z in UTC. The correct year to append is 2024, but due to the year rollover, syslog4j might incorrectly append 2025. This results in the message being misinterpreted as originating from the future, 1 year later.

The solution is to prioritize using the syslogServerTimeZone to determine the year. If syslogServerTimeZone is unavailable, fall back to the JVM's default timezone.

…llover issues due to timezone discrepancies.
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.

1 participant