Subject: | Timestamps violate RFC3164 on the first nine days of each month |
Date: | Tue, 9 Jun 2015 09:24:19 +0000 |
To: | "bug-Sys-Syslog [...] rt.cpan.org" <bug-Sys-Syslog [...] rt.cpan.org> |
From: | Markus Laker <Markus.Laker [...] hds.com> |
Section 4.1.2 of RFC3164 says:
The TIMESTAMP field is the local time and is in the format of "Mmm dd
hh:mm:ss" (without the quote marks) where:
[...]
dd is the day of the month. If the day of the month is less
than 10, then it MUST be represented as a space and then the
number. For example, the 7th day of August would be
represented as "Aug 7", with two spaces between the "g" and
the "7".
But version 0.33 of Sys::Syslog uses a leading zero instead, producing timestamps such as "Jun 09 10:12:29". Adding the following line immediately after the strftime call fixes the problem:
$timestamp =~ s/ ^ (.{4}) 0 /$1 /x;
Mandatory information (probably not useful in this case): I'm running Perl v5.20.2 on Debian Jessie.
Best regards,
Markus