1

I've been through the awstats docs for a while now, it just seems to be failing with the Logformat.

I'm using the following in awstats,

LogFormat = "%host - - %host_r %time1 %methodurl %code %bytesd %refererquot %uaquot %otherquot"

(from nginx)

 log_format   main
'$remote_addr - $remote_user [$time_local] $request '
    '"$status" $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for"';
    access_log  logs/access.log main;

Sample hits: http://pastebin.com/raw.php?i=qD9PKN52

2 Answers 2

1

I think you are missing " from around some of the objects on your log lines and you have them around others that don't need them.

Try

 log_format   main
'$remote_addr - $remote_user [$time_local] "$request" '
    '$status $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for"';
    access_log  logs/access.log main;
0

That's true. Removing "" from $status and putting them to $request should solve the problem.

Also if you already have tons of "corrupted" logs like I do, you can run:

sed -i "s/00\]\ /00\]\ \"/g" access.log

and

sed -i "s/\(HTTP\/[0-9].[0-9]\)\ \"\([0-9][0-9][0-9]\)\"/\1\"\ \2/g" access.log

This would make the old logs usable for awstats.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .