We no longer offer ftp downloads. If there is a file you need referenced here, please contact me by email and I will get it to you.
The original Squid Log Analyzer I wrote wasn't what I really wanted. I had promised myself that I would get back to it to do a better job, but of course I forgot about that until someone asked me to provide some changes. I then looked at the code again and said no, this won't do.
The first problem is that version creates static html pages. That's a waste of space and time. This new version doesn't; it generates pages as requested. This version also uses a Perl .db file to store its data.
You can download this from ftp://ftp.aplawrence.com/pub/squidlog2.tar. You need to edit two files to match your site. The first is the parsesquidlog.pl file. This needs to be run (by cron) to create the Perl .db file. Edit these lines:
$log_file = '/whereveritis/access.log'; $wlogs="/wherever/you/want/wlog"; $ipmatch="192\.168\.2\."; $purge_date="2003_01_01";
The $log_file is the location of your squid log file. The $wlogs is wherever you would like to store your .db file (this program creates it). The $ipmatch matches your local lan pattern. Finally, the $purge_date determines what log lines are kept; you will want to modify this every now and then to avoid having gigantic pages to look through.
The other program is what you'll install in your cgi-bin area. For this, modify just two variables:
The $wlogs needs to match whatever you used in the parsesquidlog.pl file, and $cgiloc just matches your cgi location.
Got something to add? Send me email.
More Articles by Tony Lawrence © 2011-03-17 Tony Lawrence