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:
$wlogs="/wherever/it/is//wlog"; $cgiloc="/cgi-bin/showlogs.pl";
The $wlogs needs to match whatever you used in the parsesquidlog.pl file, and $cgiloc just matches your cgi location.
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.
Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.
Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.
We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.
Click here to add your comments
Thu Dec 11 17:05:56 2008: Subject: Squidlog 1 JeffSouza
I love your script and how simple it is. However, the output doesn't go past the first level html file. All I get is the first page - any links on the main output are just pages with the filename in them at the top. As a side note, I could not get squidlog2 to work (i've never worked with cgi scripts and I'm not sure how to view the information from the showlogs.pl).
Please help if you can.
Thu Dec 11 17:21:58 2008: Subject: TonyLawrence
Gosh, I haven't looked at this in years. I'm not sure how to help you - if you don't grok cgi I can't educate you through comment replies.
Do you understand Perl? Or know someone who does? Any half-competent Perl person could take this base idea and improve it considerably. If you don't want to run cgi, just use the script as is and edit out the HTML output.. it's really that easy.
If you don't know anyone, I could do a rewrite specifically for you - that would run a couple of hundred dollars at most.
Thu Dec 11 17:52:43 2008: Subject: Squidlog 2 JeffSouza
I completely understand. I was only wanting to get the output you posted as an example log. I get the first page, but the information in the links aren't there. I just thought there might be a "level" setting in the script. I don't know perl, but I know C which is close enough to edit the file. Honestly, your program is the easiest with the least amount of dependencies I've found. It's basically a drop in with slackware to get running. It's just that somewhere in the parsing it fails to output to the sub .html files any details like you show in your example.
Thu Dec 11 17:54:01 2008: Subject: Squidlog 1 JeffSouza
Sorry, I should have mentioned that I was talking about your original Squidlog *not* Squidlog2 in the previous post.
Thu Dec 11 18:02:25 2008: Subject: TonyLawrence
OK. Well, if I'm not real busy over the next few weeks I might find some time to look at it. I can't promise anything, of course.
I detest code that depends on obscure modules.. so often the module changes slightly or depends on something else and soon you are chasing never ending rabbits..
Thu Dec 11 18:18:21 2008: Subject: TonyLawrence
Send me (email) a sample of your log file and I'll definitely look at it within the next two weeks if at all possible.
Include enough lines for a reasaonable test but don't send me tens of thousands of lines, please.
Thu Dec 11 18:24:23 2008: Subject: Squidlog 1 JeffSouza
Let me know where you would like me to email the log to. I'll send you 1000 lines - let me know if you want more (or less).
Thu Dec 11 18:29:15 2008: Subject: TonyLawrence
1,000 lines is good. See http://aplawrence.com/info.html for email address.
Fri Dec 12 20:08:55 2008: Subject: TonyLawrence
I haven't seen that log yet??
Don't miss responses! Subscribe to Comments by RSS or by Email
Click here to add your comments
If you want a picture to show with your comment, go get a Gravatar