Online Learning Academy - LearnAcad.com

... Sharing Knowledge

  • Increase font size
  • Default font size
  • Decrease font size
Home

How to convert Squid unixtime logs in human-readable format?

E-mail Print PDF

squid-shade1If you’re looking at squid access.log, you’ll find the first column of it is the time, for example:
 

1310313302.640 829 58.215.75.51 TCP_MISS/200 104 CONNECT smtp.126.com:25 – DIRECT/123.125.50.112 -
 

1310313303.484 1845 58.215.75.51 TCP_MISS/200 104 CONNECT smtp.126.com:25 – DIRECT/123.125.50.111 -

This is not very human readable.

To convert Squid unixtime logs in human-readable format, one can use following command:

 

perl -p -e 's/^([0-9]*)/"[".localtime($1)."]"/e' > converted.log

 

 

Last Updated on Friday, 08 November 2013 13:03  
Follow us on Twitter

Main Menu

Linux

Islam

Windows

Interview Questions

Database

Internet

Cisco

Entertainment

Networking

Graduate Courses

Psychology

Feed Burner

Subscribe to Welcome to Online Learning Academy by Email

Enter your email address:

Delivered by FeedBurner


Google Groups
Subscribe to LearnAcad
Email:
Visit this group

Login Form