[syslog-ng] date parser

Vincent Bernat bernat at luffy.cx
Sun Oct 25 23:47:15 CET 2015


 ❦ 25 octobre 2015 21:15 +0100, "Scheidler, Balázs" <balazs.scheidler at balabit.com> :

> I am basically done with cleaning up the stuff. You can find my latest
> version at https://github.com/balabit/syslog-ng/tree/f/date-parser
>
> I still have to clean up the branch, it is currently just a dump of
> patches, but the final state should be pretty close that I'd try to
> push for integration.
>
> There's one issue that is still open: strptime() at least as
> implemented in various libc versions is unusable, so we should
> probably roll our own implementation. Reasons:
>
> 1) tm_gmtoff is not portable
> 2) %z as a parsing format is not portable
> 3) %z doesn't accept ISO8601 standard zone offsets when there's a
> colon between hours and minutes

Next GNU libc will accept the colon.

Also, 4. timezone handling is incredibly tedious
>
> Also, it can be affected by locale settings (which is not good for the
> syslog-ng case) and is probably very slow. (at one point syslog-ng
> used strptime for normal log traffic and I remember replacing it with
> hand-coded routines increased performance a lot). I'll try to get an
> strptime implementation from somewhere and tailor it to our needs.

I agree.
-- 
Avoid multiple exits from loops.
            - The Elements of Programming Style (Kernighan & Plauger)


More information about the syslog-ng mailing list