Squid access.log export to excel

exportlog-filesloggingsquid

Is there a way to export the contents of access.log to excel spreadsheet so as to manipulate the data from there?

Best Answer

The squid native log format is :

time elapsed remotehost code/status bytes method URL rfc931 peerstatus/peerhost type

In the fact, you can develop a simple parser using awk or maybe with perl or python, ... and delimit the data with a delimiter of your choice to get a CSV file. Somethink like this:

 awk '{ print $1","$2","$3","$4","$5","$6","$7","$8","$9","10 }' /var/log/squid/access.log
For more information, please find here a small squid log viewer using python. http://github.com/mezgani/sqview