Categories
HowTos Linux

GoAccess on rhel/CentOS 6 Linux – Real time Apache Log Analyzer


About GoAccess :
GoAccess is linux terminal’s real time Apache Log Analyzer and gives you interactive view of Apache access log. It is super fast and provides you real time reporting on the fly.
Currently it support Apache two standard reports 1. Combined Log Format 2. Common Log Format. You can also monitor nginx log if it is configured with Apache log format.

I have been using it for a long time on Ubuntu/BackTrack and CentOS 4. This time i am compiling it on CentOS 6 on our 64bit VPS.

Installing dependencies :
yum install glib2 glib2-devel glibc make geoip

Download and Compile GoAccess-v0.4.2 :
wget http://sourceforge.net/projects/goaccess/files/0.4.2/goaccess-0.4.2.tar.gz/download
./configure
make
make install

How to use GoAccess?
To view access log in interactive mode
goaccess -f /var/log/httpd/access.log
below options can be used before -fswitch :

-b # Enable bandwidth consumptions.
-s # Enable HTTP status codes reporting
-a # Enable User Agents list by host.
-e # This is nice option, if you would like to exclude IP from
     being counted under HOST section.

Here is complete syntax to use with above options:
goaccess -b -s -e 116.193.XX.XX -a -f /var/log/httpd/access.log

If you have any issue, feel free to ask in comments.