Re: access.log timestamps

From: Alex Rousskov <rousskov@dont-contact.us>
Date: Thu, 21 May 1998 15:30:38 -0600 (MDT)

On Thu, 21 May 1998, Brian wrote:

> Is there a utility that will basically leave the logs the way they are
> except convert the timestamp to a normal common time/date?

The following script will do it for you. The script was designed for a
different purpose so there is a better way to do what you ask for.

$ ./ctime.pl < /usr/local/squid/logs/access.log | less

Alex.

-------------- ctime.pl ----------

#!/usr/local/bin/perl -w

while (<STDIN>) {
    if (/^\d+$/) {
        printf("%d = %s\n", $_, scalar gmtime($_));
    } else {
        while (/\b(\d{9})(?:\.\d\d\d)?\b/) {
            $_ = $` . scalar(gmtime($1)) . $';
        }
        print($_);
    }
}
Received on Thu May 21 1998 - 14:32:52 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:40:18 MST