Convert Squid/timestamps to a human readable format

Somebody had the brilliant idea to use Unix timestamps in the Squid log.
I suppose this makes it easy to parse, not so easy to read for us humans though!

This is an elegant and common way of solving this problem:

 
cat /var/log/squid/access.log | perl -p -e 's/^([0-9]*)/"[".localtime($1)."]"/e'
 

Hope it helps!
Andrea

Leave a Reply

Your email address will not be published.