Goaccess Nginx日誌分析

Mac 安裝

brew install goaccess

Linux 安裝

yum install goaccess -y

使用方式

可以直接針對 nginx access log 進行分析

goaccess -f laravel_access.log

開啟後選第三個,按空白鍵選擇後,Enter 送出

常用參數

-a –agent-list 啟用由主機用戶代理的列表。為了更快的解析,不啟用該項 -d –with-output-resolver 在HTML/JSON輸出中開啟IP解析,會使用GeoIP來進行IP解析 -f –log-file 需要分析的日誌文件路徑 -p –config-file 配置文件路徑 -o –output 輸出格式,支持html、json、csv -m –with-mouse 控制面板支持鼠標點擊 -q –no-query-string 忽略請求的參數部分 –real-time-html 產生HTML報告 –daemonize 守護進程模式,–real-time-html時使用