Re: Logging daemon with ISO8601 filenames

From: Paul Jarc <prj_at_case.edu>
Date: Mon, 05 Jan 2015 16:22:18 -0500

Laurent Bercot <ska-supervision_at_skarnet.org> wrote:
> Can't you run a simple filter like tai64nlocal or s6-tai64nlocal when
> you need to read the logs ?

I think Caleb is talking about the filenames, not the timestamps
within the log contents.

This is hackish, but you could set a processor like this:
svlogd '!set _at_*.t && test 1 = "$#" && readable=`echo "$1" | TZ=UTC tai64nlocal` && ln "$1" "$readable"' ./main/

Note:
- Each log file would then have two names. If you want to remove the
  _at_*.s names, that could also be done withing the processor.
- The filenames in my command would look like "2015-01-05 10:56:43.015729500.t";
  if you want a different suffix or a prefix you'd have to add that.
- TZ=UTC uses UTC for the filenames, matching svlogd's -tt stamps in
  the log contents. But use TZ=right/UTC if your system clock is
  TAI-10 instead of POSIX.


paul
Received on Mon Jan 05 2015 - 21:22:18 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:18 UTC