Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

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.

share|improve this answer

Easy enough with Perl, which has modules for working with Excel, but wouldn't a database be a more appropriate tool? Excel really seems like the wrong tool for this job. Sort of like using a lawnmower to pick flowers. Sure it will work but there are better ways.

share|improve this answer
Best. Analogy. Ever. – Mark Henderson Oct 25 '10 at 21:48

Yeah, Excel can read CSV files, so your best bet would be to alter the log format such that it's comma separated (or perhaps some other delineation token). You can then open your CSV-formatted Squid log using Excel.


Alternatively, if you don't care to alter the format, you can toss a script together to reformat to include the fields you need.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.