Re: [SQU] time stamp in access.log

From: Dan Larsson <dl@dont-contact.us>
Date: Tue, 7 Nov 2000 15:36:55 +0100 (CET)

On Tue, 7 Nov 2000, Steve Koch wrote:

| Rather than using Calamaris or other apps like it, I would like to write a
| simple perl script to pull source/destination out of access.log to track
| user activity. However, there isn't a timestamp in any of the log files
| that is apparent to me. The only number I see in access.log for example is
| something like 73606367.853, and I don't see the time in that. Am I missing
| something? Is there a timestamp in any of the log files?

The first row in the access log is your timestamp, it's seconds since the
epoch (unix timestamp).

Try this:

% cat /path/to/squid/access.log | \
     perl -nwe '/^([\d\.]+)(.*)$/o ; $time = $1 ; $therest = $2 ;
       $time = localtime($time) ; print "$time $therest\n"'

(This is supposed to be a one-liner)

|

Regards
+------
Dan Larsson | Tel: +46 8 550 120 21
Tyfon Svenska AB | Fax: +46 8 550 120 02
GPG and PGP keys | finger dl@hq1.tyfon.net

--
To unsubscribe, see http://www.squid-cache.org/mailing-lists.html
Received on Tue Nov 07 2000 - 07:39:41 MST

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