AWstats install - Logformat problem

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
mameha
Forum Newbie
Posts: 13
Joined: Thu Aug 24, 2006 1:36 am

AWstats install - Logformat problem

Post by mameha »

I've installed AWstats, but it wont read my weblogs.

My weblogs are in this format:

195.1.1.1 - - 2006/11/28 00:00:00 JST "GET / HTTP/1.0" 200 3650 "Apache=195.1.1.1.581961164639572527" "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"

AWstats will not recognise this because the date format doesnt match $time1, $time2, $time3 or $time4. I am currently trying this logformat:

LogFormat="%host %other %other %time2 %methodurl %code %bytesd %other %refererquot %uaquot"

Can you make your own $time format? I need "yyyy/mm/dd hh:mm:ss" instead of $time2 as you can see.

(Also I dont understand which logformat config variable the "Apache=195.1.1.1.581961164639572527" part belongs to).
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

time2 is YYYY/MM/DD HH:MM:SS

The Apache= bit is the last %other you have in the format string posted.

The actual log format is "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""

You can use custom time formats... see here: http://httpd.apache.org/docs/2.0/mod/mo ... ml#formats
mameha
Forum Newbie
Posts: 13
Joined: Thu Aug 24, 2006 1:36 am

Post by mameha »

ok so any idea why I am getting an error?

The error I get is this:
AWStats did not find any valid lines that match your LogFormat parameter...
Also, according to the manual $time2 is like this:
%time2 Date and time with format: yyyy-mm-dd hh-mm-ss
... note the hyphen (-) instead of the slash (/)
mameha
Forum Newbie
Posts: 13
Joined: Thu Aug 24, 2006 1:36 am

Post by mameha »

I have found a way to fix this, but I have to manually perform find/replace on the log file.

I have to replace like this:

replace "2006/12/12" with "2006-12-12"
replace " JST" with ""

It would be great if I could specify my own $time format to skip this process.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Did you not read the section of the apache manual I linked to? It shows how to specify an alternate time string format..
mameha
Forum Newbie
Posts: 13
Joined: Thu Aug 24, 2006 1:36 am

Post by mameha »

Sorry, yes I did read that but it seems to be for changing the httpd.conf of apache. I dont have access to httpd.conf, I only have access to the web logs. If I had access to httpd.conf Id just set it to the 'common' format that matches LogFormat 1 in awstats config.

So I need to configure awstats to read the weird date format used on web logs of this apache install.
Post Reply