Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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:

share|improve this question

2 Answers 2

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;
share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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