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


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.


 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;

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


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.