格式
log_format main ‘$remote_addr - $remote_user [$time_local] "$request" ‘
‘$status $body_bytes_sent "$http_referer" ‘
‘"$http_user_agent" "$http_x_forwarded_for"‘;
日志
127.0.0.1 - - [25/Sep/2018:12:02:10 +0800] "GET /admin/role-auth HTTP/1.1" 200 13545 "http://t.lonlife.cn:9200/admin/admin-roles" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" "-"
命令
goaccess -f /var/log/nginx/b.log --log-format=‘%h %^[%d:%t %^] "%r" %s %b "%R" "%u" %^‘ --date-format=%d/%b/%Y --time-format=%T
原文地址:https://www.cnblogs.com/a-flydog/p/9699025.html
时间: 2024-11-09 00:33:19