Page 1 of 1

AWstats install - Logformat problem

Posted: Tue Dec 12, 2006 2:51 am
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).

Posted: Tue Dec 12, 2006 7:28 am
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

Posted: Tue Dec 12, 2006 5:38 pm
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 (/)

Posted: Tue Dec 12, 2006 8:57 pm
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.

Posted: Tue Dec 12, 2006 10:18 pm
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..

Posted: Tue Dec 12, 2006 10:39 pm
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.