Convert Squid/timestamps to a human readable format

This post is over 3 years old, so please keep in mind that some of its content might not be relevant anymore.

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

One thought on “Convert Squid/timestamps to a human readable format”

  1. Good article! We are linking to this great post on our website. Keep up the great writing. Maggee Justinian Oneal

Leave a Reply to patriciaprice33 Cancel reply

Your email address will not be published. Required fields are marked *