Visual NGINX/Apache log analyzer

# Centos:
yum -y install geoip geoip-devel

# Debian:
sudo apt-get install build-essential
sudo apt-get install libncursesw5-dev libglib2.0-dev libgeoip-dev libtokyocabinet-dev

tar -xzvf goaccess-1.3.tar.gz
cd goaccess-1.3/
./configure --enable-utf8 --enable-geoip=legacy
make install

# create real-time report of NGINX access log:
goaccess /var/www/ -o /var/www/ --log-format=COMBINED --real-time-html

# Use custom port number
goaccess /var/www/ -o /var/www/ --log-format=COMBINED --real-time-html --port=9870

# Create static report of daily NGINX access log:
goaccess /var/www/ -o /var/www/ --log-format=COMBINED

# Ignore bots:
goaccess /var/www/ -o /var/www/ --log-format=COMBINED --ignore-crawlers

# Display real OS names. e.g, Windows XP, Snow Leopard:
goaccess /var/www/ -o /var/www/ --log-format=COMBINED --real-os

# Parse only log entries between 2 dates (including hours)
sed -n '/10\/Apr\/2019\:00\:00/,/10\/Apr\/2019\:02\:00/ p' /var/www/ | goaccess -a -o /var/www/ --log-format=COMBINED -