大多数goaccess的例子都是用来监控访问日志的,我想用goaceess监控error日志。
错误日志的格式如下:
2020/02/05 09:23:08 [crit] 9711#9711: *6 SSL_do_handshake() failed (SSL: error:1420918C:SSL routines:tls_early_post_process_client_hello:version too low) while SSL handshaking, client: X.X.X.X, server: 0.0.0.0:443
2020/02/05 09:38:21 [error] 10106#10106: *3 directory index of "/var/www/example/public_html/" is forbidden, client: 162.158.166.216, server: example.com, request: "GET /nginx-reports/ HTTP/1.1", host: "example.com"
字符串
现在我使用以下日志格式:
log-format %d %t %^, client: %h, server: %^, request: "%r", host: "%v"
型
然而,goaccess报告并没有生成有用的输出。我想在报告中看到每种错误的详细信息。
2条答案
按热度按时间llycmphe1#
在我的服务器中,这是工作的Regexp
字符串
uujelgoq2#
在此基础上,我们将使用一个新版本的GoAccess。
https://goaccess.io/man#examples
适用于
access.log
字符串
在
/etc/goaccess.conf
(系统范围)或~/.goaccessrc
(用户范围)上或在一行中,使用
'%T'
:型
Source的一个。
Or just的
型
适用于
error.log
型
源头