[nsd-users] Feature request: human-readable timestamps in logs

Stephane Bortzmeyer
2014-02-13T08:46:14Z

On Thu, Feb 13, 2014 at 09:25:41AM +0100,
 Anand Buddhdev <anandb at ripe.net> wrote
 a message of 18 lines which said:

> NSD currently writes logs with unix timestamps, like this:
>
> [1392279213] nsd[13845]: info: notify for lv. from 193.0.0.198
>
> When reading these logs, I have to keep converting the unix timestamp to
> human-readable. Could you please get NSD to optionally log directly in
> human-readable timestamps of the form:

Often requested for software which does the same (Squid, Nagios). The
solution I use is in the Squid FAQ. Here, for Icinga :

#!/bin/sh

tail -f /var/log/icinga/icinga.log | perl -p -e 's/^\[(.*)\]/"[".
localtime($1) . "]"/e'