To parse nginx logs using AWStats – their log formats need to match.
My setup is like this:
- nginx log_format (specified in nginx.conf file):
log_format main '$remote_addr - $remote_user [$time_local] $request "$status" $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for" "$document_root"'
- AWStats LogFormat (specified in your domain configuration file):
LogFormat = "%host %other %other %time1 %method %url %other %code %bytesd %refererquot %uaquot %otherquot %otherquot"
Hope it helps 🙂
Nicolas Korac
Tu m’explique comment en mettant ça :
“$status”
et ça :
%code
Comment ton code peut marcher ?
C’est juste un bon mythos.
Faut enlever les guillemets du status dans nginx … sinon ça marche pas !