Mailing List Archive

timezone
Hi,

I have a problem with the time zone.

rsyslog (8.2010) is configured:

timezone(id="CET" offset="-02:00")

$ActionFileDefaultTemplate S_Format
template (name="S_Format" type="string" string="--++++---%timegenerated%
%TIMESTAMP% [%syslogpriority%] %HOSTNAME%
%syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n")

After restarting and activating the debug option:

debug:
8654.703674288:main thread    : glbl.c: Timezone information table (1
entries):
8654.704530688:main thread    : glbl.c: tzinfo: 'CET':-02:00
8654.704745038:main thread    : rsconf.c: telling modules that config
load for 0x14e72e0 is done


cat /var/log/msgprops

Debug line with all properties:
FROMHOST: 'falcon', fromhost-ip: '127.0.0.1', HOSTNAME: 'falcon', PRI: 13,
syslogtag 'root:', programname: 'root', APP-NAME: 'root', PROCID: '-',
MSGID: '-',
TIMESTAMP: 'Jun 15 13:11:56', STRUCTURED-DATA: '-',
msg: ' test'
escaped msg: ' test'
inputname: imuxsock rawmsg: '<13>Jun 15 15:11:56 root: test'
$!:
$.:
$/:


messages:

Jun 15 13:11:56 Jun 15 13:11:56 [5] falcon root: test

in messege UTC time appears instead of CET time

What do I need to do to display the time in the desired time zone?


Kind regards

Drasko


_______________________________________________
rsyslog mailing list
https://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.
Re: timezone [ In reply to ]
I believe that that option is telling rsyslog what timezone it's in, it doesn't
change the timezone that it's displayed in (unless possibly when the timestamp
is given in a format that includes the timezone, such as the rfc-5424 format

timezone handling is done very poorly in glibc and rsyslog suffers from it as
they don't want to duplicate the complex timezone code in rsyslog.

David Lang

On Wed, 15 Jun 2022, d.jagodic via rsyslog wrote:

> Date: Wed, 15 Jun 2022 15:36:21 +0200
> From: d.jagodic via rsyslog <rsyslog@lists.adiscon.com>
> To: rsyslog@lists.adiscon.com
> Cc: d.jagodic <d.jagodic@aon.at>
> Subject: [rsyslog] timezone
>
> Hi,
>
> I have a problem with the time zone.
>
> rsyslog (8.2010) is configured:
>
> timezone(id="CET" offset="-02:00")
>
> $ActionFileDefaultTemplate S_Format
> template (name="S_Format" type="string" string="--++++---%timegenerated%
> %TIMESTAMP% [%syslogpriority%] %HOSTNAME%
> %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n")
>
> After restarting and activating the debug option:
>
> debug:
> 8654.703674288:main thread    : glbl.c: Timezone information table (1
> entries):
> 8654.704530688:main thread    : glbl.c: tzinfo: 'CET':-02:00
> 8654.704745038:main thread    : rsconf.c: telling modules that config
> load for 0x14e72e0 is done
>
>
> cat /var/log/msgprops
>
> Debug line with all properties:
> FROMHOST: 'falcon', fromhost-ip: '127.0.0.1', HOSTNAME: 'falcon', PRI: 13,
> syslogtag 'root:', programname: 'root', APP-NAME: 'root', PROCID: '-',
> MSGID: '-',
> TIMESTAMP: 'Jun 15 13:11:56', STRUCTURED-DATA: '-',
> msg: ' test'
> escaped msg: ' test'
> inputname: imuxsock rawmsg: '<13>Jun 15 15:11:56 root: test'
> $!:
> $.:
> $/:
>
>
> messages:
>
> Jun 15 13:11:56 Jun 15 13:11:56 [5] falcon root: test
>
> in messege UTC time appears instead of CET time
>
> What do I need to do to display the time in the desired time zone?
>
>
> Kind regards
>
> Drasko
>
>
> _______________________________________________
> rsyslog mailing list
> https://lists.adiscon.net/mailman/listinfo/rsyslog
> http://www.rsyslog.com/professional-services/
> What's up with rsyslog? Follow https://twitter.com/rgerhards
> NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of
> sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T
> LIKE THAT.
_______________________________________________
rsyslog mailing list
https://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.
Re: timezone [ In reply to ]
Thank you for your reply. In the rawmsg at the input to the imuxsock,
the time is correct 15:11:56
It is not clear to me why the time was changed to UTC (13:11:56)? Does
this mean if there is no time zone id, the time changes to UTC?

BR

Drasko

Am 15.06.2022 um 20:13 schrieb David Lang:
> I believe that that option is telling rsyslog what timezone it's in,
> it doesn't change the timezone that it's displayed in (unless possibly
> when the timestamp is given in a format that includes the timezone,
> such as the rfc-5424 format
>
> timezone handling is done very poorly in glibc and rsyslog suffers
> from it as they don't want to duplicate the complex timezone code in
> rsyslog.
_______________________________________________
rsyslog mailing list
https://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.