Simple NGINX log file analyzer [closed]

2019-03-07 22:10发布

I'm looking for a simple tool to analyze my NGINX logs on my macbook. I want to be able to get some basic stats including bot access and also be able to sort/filter the logs to find out what happened right before the server crashed.

5条回答
太酷不给撩
2楼-- · 2019-03-07 22:18

I've now tried Splunk, it's a pretty powerful tool and they have a free version as well.

查看更多
倾城 Initia
3楼-- · 2019-03-07 22:25

I've come across visitors. It's written in C and is pretty fast.

It lacks goaccess' cool ncruses interface. It only outputs html. It does the job, though.

Edit: It can also output human-readable text reports:

visitors access.log | less
查看更多
仙女界的扛把子
4楼-- · 2019-03-07 22:27

The request-log-analyzer gem now has Nginx support in the master branch and i'm looking for someone to test it. http://github.com/wvanbergen/request-log-analyzer.

查看更多
我只想做你的唯一
5楼-- · 2019-03-07 22:33

I will suggest to use logstash and Kibana with following patterns :

for access.log :

NGINXACCESS %{IPORHOST:clientip} - %{USERNAME:remote_user} \[%{HTTPDATE:time_local}\] %{QS:request} %{INT:status} %{INT:body_bytes_sent} %{QS:http_referer} %{QS:http_user_agent}

for error.log:

 NGINXERROR (?<timestamp>%{YEAR}[./-]%{MONTHNUM}[./-]%{MONTHDAY}[- ]%{TIME}) \[%{LOGLEVEL:severity}\] %{POSINT:pid}#%{NUMBER}: %{GREEDYDATA:errormessage}(?:, client: (?<clientip>%{IP}|%{HOSTNAME}))(?:, server: %{IPORHOST:server})(?:, request: %{QS:request})?(?:, host: %{QS:host})?(?:, referrer: \"%{URI:referrer})?
查看更多
Rolldiameter
6楼-- · 2019-03-07 22:38

You may try with GoAccess; free and open source console based. It may output an HTML report too.

查看更多
登录 后发表回答