Early Know nginx log analysis tool goaccess, but before because only static analysis, feel not too strong. Recently found it is able to display reports in real time and the report is much more powerful than before to do trend analysis. So be decisive to download the installation. The following is a CentOS-based installation configuration step.
1, installation GeoIP
sudo yum install GeoIP geoip-devel
2. Installation
Centos:yum Install go Access
or source Installation
$ wget http://tar.goaccess.io/goaccess-1.1.1.tar.gz $ TAR-XZVF goaccess-1.1.1.tar.gz $ cd GOACCESS-1.1.1/$./configure- -enable-geoip--enable-utf8 $ make # make install
3. Configuration time and log format
sudo vim/usr/local/etc/goaccess.conf
Remove comments from the following items
1. Apache/nginx Time Format Time-format%h:%m:%s
2. Apache/nginx Date format Date-format%d/%b/%y
3. NCSA comobined log format Log-format%h%^[%d:%t%^] "%r"%s%b "%r" "%u"
4. Run the following command for real-time analysis
Goaccess-f/home/wwwlogs/access.log-o <output_path>/state.html--real-time-html--date-spec=hr--hour-spec= Min--ws-url=www.cbcye.com
Effect Preview
Building a simple real-time log analysis system using Goaccess