awstats não pode analisar meu log

3

Eu quero usar o AwStats para analisar os registros de acesso do nginx.

O formato de registro nginx especificado é

'$remote_addr - $remote_user [$time_local]  $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

e os registros parecem ter sido criados corretamente.

O formato de log AwStats é

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

Quando tento executá-lo a partir da linha de comando, recebo a seguinte saída de erro:

Running '"/usr/lib/cgi-bin/awstats.pl" -update -config=default -configdir="/etc/awstats"' to update config default
Create/Update database for config "/etc/awstats/awstats.conf" by AWStats version 7.2 (build 1.992)
From data in log file "/.../****-access.log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
AWStats did not find any valid log lines that match your LogFormat parameter, in the 50th first non commented lines read of your log.
Your log file /.../****-access.log must have a bad format or LogFormat parameter setup does not match this format.
Your AWStats LogFormat parameter is:
%host - %logname %time1 %code %methodurl %bytesd %refererquot %uaquot %otherquot
This means each line in your web server log file need to have the following personalized log format:
%host - %logname %time1 %code %methodurl %bytesd %refererquot %uaquot %otherquot
And this is an example of records AWStats found in your log file (the record number 50 in your log):
1.2.3.4 - - [20/Sep/2015:14:18:24 +0200]  200 "POST /somescript.php HTTP/1.1" 1277 "http://some.refer.er" "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0" "-"
Setup ('/etc/awstats/awstats.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

Já experimentei algumas variáveis diferentes (o tutorial que eu segui originalmente tinha %code e %methodurl comutado e usado %host_r em vez de %logname ), mas até agora não consegui fazê-lo funcionar.

Eu até tentei substituir %logname por - porque imaginei que o nome de usuário remoto ausente poderia confundir AwStats, mas sem sucesso.

Para mim, o formato de log e a linha de log real da mensagem de erro parecem que devem corresponder. O que eu senti falta?

    
por liz 20.09.2015 / 14:55

1 resposta

0

aqui está a configuração de log que eu tive que usar no awstats para que ele funcionasse.

LogFormat = "%host %other %other %time1 %methodurl %code %bytesd %refererquot %uaquot"

Isto é baseado no formato de log out box do nginx

    
por 21.09.2015 / 14:20

Tags