The following guide is the result of a problem I met while trying to analyze old Squid files log with Awstats.
The problem was that the Squid option to write the log format in HTTPD common log file format was disabled and so it was impossible analyzed all previous Squid log files.
So I post this guide to explain how allow Awstats to analyze Squid log format formatted in native mode.
First of all there is a useful free software available at: http://pwebstats.gleeson.net/
The author is Martin Gleeson and he wrote the perl script we need to convert the squid log file.
Save the zipped application file, uncompress it and save the squid2common.pl file in /unix-folder/.
To convert the file simply run the perl script:
perl /unix-folder/squid2common.pl squid-access-log-file
The script will generate two different log files (cache.convert and proxy.convert), the proxy.convert one contains the information Awstats needs to make the reports.
Personally I run the scrip for all old Squid log file and I create a unique access_log file (set up in the awstats.site.com) needed by Awstats to make the statistics with the command:
less cache.convert >> access_log
Finally we must set up the correct LogFormat option on awstats.site.conf in order to allow Awstats to read the squid log file converted:
LogFormat=4
In this way, running the Awstats perl command to update the statistics, we will be able to have in our reports the old squid log files not directly processable by Awstats.
Enrico Aillaud



#1 by narni on March 18, 2011 - 4:15 pm
Please provide the code