【问题标题】:goaccess nginx logformat issuegoaccess nginx日志格式问题
【发布时间】:2016-01-27 21:17:55
【问题描述】:

刚安装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  

但得到一个错误

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

【问题讨论】:

    标签: nginx goaccess


    【解决方案1】:

    你可以试试这个格式:

    log-format %^ %^ %h %T %^ %dT%t+%^ %m %U %H %s %b
    date-format %Y-%m-%d
    time-format %H:%M:%S
    

    【讨论】:

    • 谢谢。在你写这个之前我已经做到了.. 但是在你的模板中我在“带宽”中看到只有 0 个字节......无论如何,谢谢你的帮助
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-01
    • 2012-09-13
    • 1970-01-01
    • 1970-01-01
    • 2020-05-21
    • 1970-01-01
    相关资源
    最近更新 更多