Re: timestamps in access.log

From: Christian Balzer <cb@dont-contact.us>
Date: Mon, 18 Aug 1997 16:19:45 +0200 (MET DST)

Paul Gracy wrote:
>
>I'm guessing that the first entry on each line in access.log is a time stamp.
> How do I make it readable (YY/MM/DD or similar)?
>
I asked the same a long time ago and got this nice
gem as a reply:

---
#!/usr/bin/perl
#
# Date Converting Filter - Simon Amor, 7th October 1996 <spa@dmu.ac.uk>
#
# Usage: cat access.log | ./dateconv.pl | less
#
while (<>) {
 if (/^(\d+)(\..+)$/) {
  $time=localtime($1);
  print substr($time,0,11).substr($time,20,4).substr($time,10,9)."$2\n";
 }
}
---
Always Read The Fine ML Archive... ;-)
<CB>
-- 
  // <CB> aka Christian Balzer, Tannenstr. 23c, D-64342 Seeheim, Germany
\X/  CB@brewhq.swb.de | Voice: +49 6257 83036, Fax/Data: +49 6257 83037
SWB  - The Software Brewery - | Team H, Germany HQ | Anime no Otaku
Received on Mon Aug 18 1997 - 07:22:55 MDT

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