GoAccess Nginx日志格式未知

问题描述

刚刚安装了GoAccess,我想从日志中提取数据,但是我无法理解正确的* format:(

这是我日志中的一个示例片段:

Aug 26 09:20:39 host remote_addr: [0.000 - .] - testdomain.com - 10.00.123.123,69.22.1.34 - - [26/Aug/2020:09:20:39 +0200]  "GET /media/image.jpg HTTP/1.1" 304 0 "https://testdomain.com/test.html" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/84.0.4147.135 Safari/537.36"

Nginx conf:

log_format main '[$request_time $upstream_response_time $pipe] - $host - $remote_addr - $remote_user [$time_local]  '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';

解决方法

以这种方式解决:

日期格式%d /%b /%Y

时间格式%H:%M:%S

日志格式[%T%^%^]-%v-〜h {,}-%e [%d:%t%^]--“%r”%s%b“%R”“ %u“