Changing Syslog timestamp to UTC
matthew at FreeBSD.org
Fri Nov 25 17:14:59 UTC 2016
On 11/25/16 17:06, San s wrote:
> Tried exporting TZ=UTC and restarting syslogd. This shows the syslogd
> restart related messages in UTC, but not rest of the messages. They
> are still showing up as system timezone.
That's because the timestamp isn't generated by syslogd, but by the
program that logs the message. This is what the -T option exists for --
except it only applies to system log messages received across the network.
About the only way I can suggest for solving this is to use rsyslog from
ports -- I believe that has the capability of changing the timestamp to
when it received the log messages, rather than when it was originally
generated. Plus it uses a rather more sensible timestamp format so the
date-time is a single column in the output, and you can tell what the
timezone offset from UTC was.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: OpenPGP digital signature
More information about the freebsd-questions