Simple NGINX log file analyzer

NginxAnalytics

Nginx Problem Overview


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.

Nginx Solutions


Solution 1 - Nginx

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

Solution 2 - Nginx

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

Solution 3 - Nginx

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})?

Solution 4 - Nginx

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.

Solution 5 - Nginx

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionuweView Question on Stackoverflow
Solution 1 - NginxAlex MazzariolView Answer on Stackoverflow
Solution 2 - Nginxmoebius_eyeView Answer on Stackoverflow
Solution 3 - NginxDavidView Answer on Stackoverflow
Solution 4 - NginxBart ten BrinkeView Answer on Stackoverflow
Solution 5 - NginxuweView Answer on Stackoverflow