1

刚刚安装goaccess,我想解析 nginx 日志,但不明白如何制作正确的日志格式。在 nginx.conf 我有这种格式

'$server_addr $server_port $remote_addr $request_time $upstream_response_time $time_iso8601 $request  $status $body_bytes_sent';  

和文件中的日志和平

192.168.2.35 8382 192.168.2.98 38.547 38.547 2016-01-14T13:30:22+02:00 POST /test/search?id=4587252-16 HTTP/1.1 200 4185  

在 goaccess conf 文件中,我有这种格式

date_format %Y/%m/%d  
time-format %H:%M:%S  
log-format %h %^ %r %T %^ %^ %r %s %b  

但得到一个错误

“没有有效的处理。验证您的日期/时间/日志格式”

4

1 回答 1

1

你可以试试这个格式:

log-format %^ %^ %h %T %^ %dT%t+%^ %m %U %H %s %b
date-format %Y-%m-%d
time-format %H:%M:%S
于 2016-01-25T12:47:34.180 回答