[afnog] Awstats and Squid logs

Evelyn Namara evelyn.namara at orange.co.ug
Mon Jun 8 14:54:46 UTC 2009


Dear folks,

I need some awstats users to help me out here. I have set up and used Awstats for for analyzing mostly http
web traffic and it works perfectly.

I wanted to have a similar setting for squid [ to have awstats analyze my proxy logs] since it says it has support for this too, but I have problems with my logformat.

Here is my setup so far:

In my awstats.conf file I have the following set:

logformat=4 [ which should work for squid, according to the documentation]

Then in my squid.conf;
I added this combined log format;

logformat combined %>a %ui %un [%{%d/%b/%Y:%H:%M:%S +0000}tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh

which should also be good according to this;
http://longsleep.org/1/howto/squidawstats

The awstats setup added the following lines to my apache2 httpd.conf file;

CustomLog logs/access_log combined


# Directives to allow use of AWStats as a CGI
#
Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"

#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory "/usr/local/awstats/wwwroot">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

Those are the bits I have in all my 3 files, awstats.conf, httpd.conf and squid.conf,

however when I restart my apache2, and squid after the changes, my log format in access.log file still look like
normal squid logs, they haven't changed format to what awstats wants.

Here is the error I get;

Create/Update database for config "/etc/awstats/awstats.xxxxxx.conf" by AWStats version 6.9 (build 1.925)
>From data in log file "/var/log/squid/access.log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
AWStats did not find any valid log lines that match your LogFormat parameter, in the 50th first non commented lines read of your log.
Your log file /var/log/squid/access.log must have a bad format or LogFormat parameter setup does not match this format.
Your AWStats LogFormat parameter is:
4
This means each line in your web server log file need to have "common log format" like this:
111.22.33.44 - - [10/Jan/2001:02:14:14 +0200] "GET / HTTP/1.1" 200 1234
And this is an example of records AWStats found in your log file (the record number 50 in your log):
1244336571.390     18 172.19.4.111 TCP_CLIENT_REFRESH_MISS/304 336 GET http://172.19.3.111:1158/em/cabo/images/cache/c-stlu.gif - DIRECT/172.19.3.111<http://172.19.3.111> image/gif
Setup ('/etc/awstats/awstats.xxxx.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

Anybody who can point me to something more that I can tryout?

Note: My squid version is; 2.6.STABLE21

KR,

[cid:image001.jpg at 01C9E862.356F3790]


Evelyn Namara
Information Technology

Mobile:       +256 (0)79 0790 183
Direct line:  +256 (0)79 0792 183
Fax:           +256 (0)41 7772 001

Orange Uganda Limited,
Plot 28-30 Clement Hill Road,
P. O. Box 24144, Kampala, Uganda
evelyn.namara at orange.co.ug<mailto:name.surname at orange.co.ug>



**************************************************
This message and any attachments (the "message") are confidential and intended solely for the addressees.
Any unauthorised use or dissemination is prohibited.
Messages are susceptible to alteration.
Orange Uganda Limited shall not be liable for the message if altered, changed or falsified.
If you are not the intended addressee of this message, please cancel it immediately and inform the sender.
**************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://afnog.org/pipermail/afnog/attachments/20090608/f9d0030b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 885 bytes
Desc: image001.jpg
URL: <http://afnog.org/pipermail/afnog/attachments/20090608/f9d0030b/attachment.jpg>


More information about the afnog mailing list