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
date-parser: extend %z to support time zones other then local and gmt #3453
Conversation
Build SUCCESS |
d1e4c21
to
dec2556
Compare
Build SUCCESS |
I think this drops support for recognizing the name of the timezone that is currently set on the current host running syslog-ng. e.g. the tzname global variable that is set by libc. Try setting CET as the current timezone and send a message using "CET" as the timezone name. I am not sure this is that useful, but Ciscos tend to send timezone names instead of offsets and at the very least those would be recognized as long as the router is in the same timezone. In contrast to this we should attempt to recognize any timezone names, that we could extract from tzinfo files, as we do with allowed timezone offsets (e.g. _is_gmtoff_valid() function in unixtime.c) |
Signed-off-by: Kokan <kokaipeter@gmail.com>
Porting NetBSD libc: NetBSD/src@1ab7665 Signed-off-by: Kokan <kokaipeter@gmail.com>
Signed-off-by: Kokan <kokaipeter@gmail.com>
Signed-off-by: Kokan <kokaipeter@gmail.com>
dec2556
to
08e54a4
Compare
Build SUCCESS |
Nice! |
@rfaircloth-splunk Once we discussed syslog-ng's date-parser() "%Z" format parsing timezone names. This branch improves that with the US based timezone names, still not global, but stuff like EST/EDT would be recognized with this branch integrated. Do you also see non-US timezones in the wild? I guess you do, I just wanted to gauge if it makes sense to support those as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could still be improved with all the global timezone names, but still a useful step.
There is already two approve and green CI, so I am merging this. |
Our date parser is based on the NetBSD
strptime
implementation, that differs from the linux implementation.The version of
strptime
used from NetBSD supported local and GMT timezone with%z
and the%Z
supported the other timezones. This was changed in linux and also in later version of NetBSD.In our documentation the newer NetBSD behaviour was written, this patch updates to code accordingly.