goaccess图形化日志管理分析工具
server1:
[root@server1 nginx]# vim conf/nginx.conf
server {
listen 8080;
server_name localhost;
#access_log logs/westos.access.log main;
location /report.html {
alias /usr/local/nginx/html/report.html;
}
tar zxf goaccess-1.3.tar.gz
cd goaccess-1.3/
./configure --help
yum install GeoIP-devel-1.5.0-11.el7.x86_64.rpm #安装依赖
yum install ncurses-devel -y
./configure --prefix=/usr/local/goaccess --enable-utf8 --enable-geoip=legacy --with-openssl
make && make install
ln -s /usr/local/goaccess/bin/goaccess /usr/bin/ #链接可执行文件到/usr/bin/
cd /usr/local/nginx/logs/
goaccess access.log -o ../html/report.html --real-time-html --time-format='%H:%M:%S' --date-format='%d/%b/%Y' --log-format=COMBINED #分析nginx服务access.log日志,以html页面展示
–date-format= - Specify log date format. e.g., %d/%b/%Y
–log-format= - Specify log format. Inner quotes need to be escaped, or use single quotes.
–time-format= - Specify log time format. e.g., %H:%M:%S