Guide To Install and Use GoAccess Realtime web logs Analyzer

Written on 21 June 2016

GoAccess is an open source real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser.

It provides fast and valuable HTTP statistics for system administrators that require a visual server report on the fly.4
Goaccess tutorial series:
- Guide To Install and Use GoAccess Realtime web logs Analyzer.
- Use Goaccess Visual Web log analyzer on HTTP Web Browser(use Nginx)
- Run Goaccess as service use Systemd.

Guide To Install and Use GoAccess

  1. Install Use Official GoAccess' Debian/Ubuntu Repository
$ echo "deb http://deb.goaccess.io/ $(lsb_release -cs) main" | sudo tee -a /etc/apt/sources.list.d/goaccess.list 
$ wget -O - https://deb.goaccess.io/gnugpg.key | sudo apt-key add -
 $ sudo apt-get update 
$ sudo apt-get install goaccess

For other distro read at https://goaccess.io/download
Or build from source:

sudo apt-get install build-essential  
sudo apt-get install libncursesw5-dev libglib2.0-dev libgeoip-dev libtokyocabinet-dev  
$ wget http://tar.goaccess.io/goaccess-1.0.1.tar.gz 
$ tar -xzvf goaccess-1.0.1.tar.gz 
$ cd goaccess-1.0.1/ $ ./configure --enable-geoip --enable-utf8
$ make 
# sudo make install 
  1. Config
    Config file locate at /etc/goaccess.conf if you install use repository.
    If build from source type this command:
vim /usr/local/etc/goaccess.conf  

Then edit date,time, log format
For example for Nginx log format uncomment those line

# The following time format works with any of the
# Apache/NGINX's log formats below.
#
time-format %H:%M:%S  
# The following date format works with any of the
# Apache/NGINX's log formats below.
#
date-format %d/%b/%Y  
# NCSA Combined Log Format
#
log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u"  

3. Using
Type goaccess -f /path/to/log/file and hit Enter then type h for hep.
Example

goaccess -f /var/log/nginx/access.log  

Result
Goaccess web logs Analyzer For use Goaccess in browser you must do some config , read this blog post for more detail: Use Goaccess Visual Web log analyzer on HTTP Web Browser.

Goacces resource: