GoAccess for Nginx Log


Add official repository

echo "deb http://deb.goaccess.io/ $(lsb_release -cs) main" | tee -a /etc/apt/sources.list.d/goaccess.list
wget -O - https://deb.goaccess.io/gnugpg.key | apt-key add -

Update

apt-get update
apt-get upgrade

Check version

goaccess --version

Edit configure for nginx log format

vim /etc/goaccess.conf

    time-format %H:%M:%S
    date-format %d/%b/%Y
    log-format %h - %^ [%d:%t %^]  "%r" %s %b "%R" "%u" %T "%^"

View single access log file

goaccess -f /usr/local/nginx/log/access.log

View multi access log files

cat /usr/local/nginx/log/access.* | goaccess

View multi access log files in one file

zcat -f /usr/local/nginx/log/access.* | goaccess

Output to html file format

zcat -f /usr/local/nginx/log/access.* | goaccess > /path/to/output.html

Reference