GoAccess是一個很是良心的開源軟件,它的良心之處體如今以下方面:
1)安裝簡單;
2)操做容易;
3)界面酷炫;
GoAccess 官網 https://goaccess.iocss
[root@clsn.io /root] #cat /etc/redhat-release CentOS release 6.8 (Final) [root@clsn.io /root] #uname -a Linux clsn.io 4.10.5-1.el6.elrepo.x86_64 #1 SMP Wed Mar 22 14:55:33 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux [root@clsn.io /root] #sestatus SELinux status: disabled
官網提供多種系統版本的安裝方法: https://goaccess.io/download#installationhtml
$ 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
配置完成的信息linux
Your build configuration: Prefix : /usr/local Package : goaccess Version : 1.3 Compiler flags : -pthread Linker flags : -lnsl -lncursesw -lGeoIP -lpthread Dynamic buffer : no Geolocation : GeoIP Legacy Storage method : In-memory Hash Database (Default) TLS/SSL : no Bugs : goaccess@prosoftcorp.com
注:本次分析日誌爲 nignx 標準輸出日誌nginx
[root@clsn.io /var/log/nginx] clsn.io Blog WebSite #goaccess -f clsn.io.log
日誌格式選爲 NCSA Combined Log Format
json
回車便可看到當前日誌分析結果
查看當前配置segmentfault
[root@clsn.io /usr/local/etc/goaccess] clsn.io Blog WebSite #egrep -v "^#|^$" goaccess.conf config-dialog false hl-header true json-pretty-print false no-color false no-column-names false no-csv-summary false no-progress false no-tab-scroll false with-mouse false agent-list false with-output-resolver false http-method yes http-protocol yes no-query-string false no-term-resolver false 444-as-404 false 4xx-to-unique-count false all-static-files false double-decode false ignore-crawlers false crawlers-only false ignore-panel REFERRERS ignore-panel KEYPHRASES real-os true static-file .css static-file .js static-file .jpg static-file .png static-file .gif static-file .ico static-file .jpeg static-file .pdf static-file .csv static-file .mpeg static-file .mpg static-file .swf static-file .woff static-file .woff2 static-file .xls static-file .xlsx static-file .doc static-file .docx static-file .ppt static-file .pptx static-file .txt static-file .zip static-file .ogg static-file .mp3 static-file .mp4 static-file .exe static-file .iso static-file .gz static-file .rar static-file .svg static-file .bmp static-file .tar static-file .tgz static-file .tiff static-file .tif static-file .ttf static-file .flv
由上可見默認配置中並沒有時間參數,須要在配置中添加時間參數。bash
[root@clsn.io /usr/local/etc/goaccess] clsn.io Blog WebSite #cat >>goaccess.conf<<EOF > time-format %H:%M:%S > date-format %d/%b/%Y > #NCSA Combined Log Format > log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u" > EOF [root@clsn.io /usr/local/etc/goaccess] clsn.io Blog WebSite #cp -a goaccess.conf ../
30 * * * * /usr/local/bin/goaccess /var/log/nginx/clsn.io.log* -o /www/wwwroot/monitor/report.html -p /usr/ local/etc/goaccess/goaccess.conf
1.3.3 檢查生產頁面
https://monitor.clsn.io/report.htmlsvg
https://www.linuxidc.com/Linux/2016-12/138731.htm
https://goaccess.io/man
https://goaccess.io/
https://www.imydl.tech/lnmp/197.html
https://segmentfault.com/a/1190000011025155ui