Goaccess to view nginx logs in real time

Why can't 80% of the code farmers be architects? >>>  hot3.png

aims

usegoaccessView nginx logs in real time on the browser.

step

Install goaccess

Log in to the CentOS server and install goaccess using yum:

yum install goaccess
There is no available package goaccess.

There is no goaccess in yum of centos7, and then only compile and install manually.

Install dependencies

yum install ncurses-devel
yum install geoip-devel
yum install tokyocabinet-devel
yum install openssl-devel

Install goaccess manually

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

Configure nginx

vim /var/nginx/conf/nginx.conf
 # Add request configuration
location /report.html {
                alias /var/nginx/html/report.html;
        }

Restart nginx

systemctl restart nginx.service

Use goaccess

cd /var/nginx/logs
goaccess budget.access.log -o ../html/report.html --real-time-html --time-format='%H:%M:%S' --date-format='%d%b%Y' --log-format=COMBINED

verification

In a browser, openhttp: // xxxxx: 8080 / report.html, you can view the real-time log, the effect is as follows:

nginx_goaccess

reference

Reprinted at: https://my.oschina.net/fxtxz2/blog/2994272

Intelligent Recommendation

How to view Nginx real -time logs in Google Analytics

Google Analytics is a very useful tool for webmaster, and it can analyze website traffic in detail. But as Adblock is becoming more and more popular, we can see less and less data on Google Analytics....

Use goaccess to analyze nginx logs

The bad environment is ubuntu 18.04 Install first Install goaccess Download geoIp: Then output the file:...

Nginx, tomcat access log quasi-real-time analysis and statistics--goaccess

Requirements: Get the online user access log analysis and statistics results in time, so as to provide decision-making for development, testing, operation and maintenance, and operations personnel! I ...

CentOS 8 Nginx GoAccess Real-Time Analysis Access Log

1.1.1 Real-time browsing cannot be used, 1.2 version can. Source installation Modify the configuration file Nginx log configuration file Page real-time display Place Report.html in the web server dire...

Docker view real-time logs

Docker logs View real-time logs docker logs -f -t --since=“2017-05-31” --tail=10 f41c6a557eb6 –since : This parameter specifies the output log start date, that is, only the log after...

More Recommendation

View container logs in real time

View container logs in real time Introduce an open source gadget that has been used for several months,Dozzle. It is a lightweight and simple container log viewing tool. This article will briefly intr...

Nginx study notes-GoAccess analysis of Nginx logs

GoAccess analyzes Nginx logs Official website: https://goaccess.io/ Why does Nginx need GoAccess logs Because GoAccess can be used to analyze Access.log in real time, including graphical display, and ...

Nginx log View GoAccess installation

2019 Unicorn Enterprise Heavy Recruitment Python Engineer Standard >>> Nginx log View GoAccess installation Ready to work: Linux CentOs 6.5 Nginx 1.8 Prepared before installation Switch to / ...

GoAccess real-time log monitoring

After the service number GoAccess is installed, execute Discovering parameters --Real-Time-HTML unable to refresh HTML in real time Solution: The default goaccess will listen to the port 7890's WebSoc...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top