We have updated Graylog from version 6.1.1 to 6.1.5.
Since then, it seems that the timestamp with which messages are recorded is wrong.
Let me explain. With version 6.1.1, messages received were saved with a UTC timestamp (Graylog server time is in UTC, and root_timezone in server.conf is also in UTC)
We had set our user profiles to display messages in our local time zone (Paris). Everything was correct.
Since the installation of version 6.1.5, without changing the Graylog server settings, messages are recorded in Graylog in our time zone (Paris). Messages are then displayed in the graphical interface with one hour too many. It’s true that you can change the time zone in the user profile, but this isn’t logical and so the messages before updating are displayed with the wrong time zone.
The line “root_timezone = UTC” is commented dans le fichier server.conf but normally this is the default value.
Attached are several screenshots: a message in version 6.1.1 (with user profile set to UTC), a message in 6.1.5 (with user profile set to UTC), the time configuration on the Graylog server and the configuration in server.conf.
Messages come from the same source server.
We’ve got one pipeline on these messages. This pipeline only extracts IPv4 address form message with grok pattern %{IPV4} and this pipeline already existed in version 6.1.1.
The default timezone for our syslog input is “Not configured” (we haven’t made any changes on this side). Should we change this value ?
Your log messages don’t have a syslog timestamp at the beginning (after the pri field). So GL assigns the received time as timestamp.
If you don’t want that to be UTC, I think you will need to set the root_timezone config.
If you want to use the timestamp from the informational part of the syslog message, you will need to parse it out and assign it to the timestamp field in a pipeline rule.
With version 6.1.1, these same logs were recorded with a UTC timestamp, and this worked well for us.
Now the timestamps are in local time, even though we haven’t changed the configuration. This means that Graylog assigns a local time to messages instead of UTC. How can we get Graylog to assign UTC time to incoming messages (we’re not interested in the timestamp contained in our message)?
If I set timezone to “Paris” (which is my local time) in my user profile, timestamps show a future time! (example: 16:00 in the afternoon when it is 15:00 in local time)
The Syslog UDP decoder sets the message timestamp to the receive timestamp, when it cannot find a valid timestamp in the UDP message. In your example, both are the 13:57:45.000 so that is as expected. Raw receive timestamp is UTC. Is there any chance the log source is now sending UTC instead of Paris time?
How can I check whether the Graylog timestamp was determined by the timestamp contained in the message or by the reception datetime ?
As you can see in the screenshot attached, sometimes the Graylog Timestamp is not equal as the timestamp contained in the message so I think that the Graylog timestamp is determined by the reception time and not extracted from message.(unless there is a timestamp rounding done by Graylog)
In the screenshot attached, I’ve displayed the gl2_receive_timestamp
As you can see, the original message was sent at “10:36:48.905” (local time - Paris), was received (gl2_receive_timestamp) at “09:36:49.063” (UTC and one second delay) and timestamp is “10:36:49.000 (local time)”.
It seems that timestamp time was extracted from gl2_receive_timestamp and not from message content.
So why is the timestamp displayed in local time when my user profile is in UTC?
Date parsing is complex - hard to pin down where your timezone is exactly being set by code reading alone. Clearly though, message timestamp is in Paris TZ, while the raw message timestamp is in UTC.
I would just go ahead and update the Syslog input to have timezone etc/UTC and allow_override_date=true. That should do the trick.