Index | Thread | Search

From:
Job Snijders <job@bsd.nl>
Subject:
ts(1) & ISO8601 by default (Was: httpd: add timestamps to fastcgi error log)
To:
tech@openbsd.org
Date:
Mon, 2 Nov 2026 13:16:34 +0000

Download raw body.

Thread
On Mon, Nov 02, 2026 at 01:49:32PM +0100, Claudio Jeker wrote:
> I would love if syslogd would default to -Z. The default timestamps
> are just horrible to work with and lack sub second precision. Also the
> -Z output is a lot simpler to parse and convert.

Somewhat related: tools like ts(1) use strftime(3) for the format,
but strftime(3) does not provide an easy single character conversion
specification for ISO8601 timestamps. You have to do something like
'echo hi | ts %Y-%m-%dT%H:%M:%SZ', which is a bit long.

Does anyone see some way to improve on this? Some options I considered:

Adding an extra option to ts(1) seems less desirable because it would
somewhat conflict with the interface people are used to.

Maybe just changing the default format in ts to '%Y-%m-%dT%H:%M:%SZ'
might be better?

Or perhaps strftime(3) could be extended?

Thoughts?

Kind regards,

Job