Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple NGINX log file analyzer [closed]

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.

like image 539
uwe Avatar asked Sep 25 '12 18:09

uwe


People also ask

How long are Nginx logs kept?

You can set up logrotate for nginx, in this way you can maintain logs for 30 days or more as per your requirements !

Can I delete nginx access log?

You can remove access. log as root user, or using sudo.

How do I enable access logs in nginx?

The access log can be enabled either in http , server , or location directives block. By default, the access log is globally enabled in the http directive inside the main Nginx configuration file. For better readability, it is recommended to set a separate access log file for each server block.


2 Answers

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

like image 183
Alex Mazzariol Avatar answered Sep 22 '22 15:09

Alex Mazzariol


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 
like image 33
moebius_eye Avatar answered Sep 20 '22 15:09

moebius_eye