The timestamp is written as
2015-03-04T15:02:02.566782+0100
unfortunately, this is not an RFC3339 timestamp as demanded by rfc5424.
The colon in the time offset field is missing. The correct timestamp is
2015-03-04T15:02:02.566782+01:00
(Note "+0100" vs. "+01:00")
if ((tm = localtime(&tv.tv_sec)) != NULL) {
char fmt[64];
- strftime(fmt, sizeof(fmt), " %Y-%m-%dT%H:%M:%S.%%06u%z",
- tm);
+ const size_t i = strftime(fmt, sizeof(fmt),
+ " %Y-%m-%dT%H:%M:%S.%%06u%z ", tm);
+ /* patch TZ info to comply with RFC3339 (we left SP at end) */
+ fmt[i-1] = fmt[i-2];
+ fmt[i-2] = fmt[i-3];
+ fmt[i-3] = ':';
snprintf(time, sizeof(time), fmt, tv.tv_usec);
} else
err(EXIT_FAILURE, _("localtime() failed"));