0

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

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

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的配置:

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"';
4

1 回答 1

0

以这种方式解决:

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

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

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

于 2020-09-21T07:53:20.193 回答