Analyze nginx logs

install | source | nginx | advanced | analyze | php | redirect

Install

wget https://tar.goaccess.io/goaccess-1.4.6.tar.gz
tar xzf goaccess-1.4.6.tar.gz
cd goaccess-1.4.6/
./configure --enable-utf8 --enable-geoip=mmdb
make
make install

Usage

cd /var/log/nginx/
head access.log
tail access.log

TUI

goaccess access.log -c

one-shot WUI

goaccess access.old.log -o /var/www/html/report.old.html --log-format=COMBINED

real-time WUI

goaccess access.log -o /var/www/html/report.html --log-format=COMBINED --real-time-html

Deal with 404s

grep ' 404 ' access.old.log | awk '{print $7}' \
    | grep -vE '\.php$|^/wp-' \
    | sort -u

Resources

Downloads https://goaccess.io/download

Top 5 NGINX Log Analyzer Tools – Driving Business Growth with Data https://www.dnsstuff.com/top-5-nginx-log-analyzer-tools

Nginx Virtual Host Log Format https://gist.github.com/jyap808/10570005

Virtual host log format https://subscription.packtpub.com/book/networking_and_servers/9781786466174/5/05lvl1sec42/virtual-host-log-format


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun