语法 #
goaccess [filename] [ options ... ] [-c][-M][-H][-q][-d][...]
选项 #
下面的选项可以通过命令行使用,如果是长选项则通过配置文件。
日志/日期/时间 格式 #
--time-format <timeformat>
--date-format <dateformat>
--log-format <logformat>
用户交互选项 #
-c --config-dialog
-i --hl-header
-m --with-mouse
--color=<fg:bg[attrs, PANEL>
--color-scheme <1|2|3>
--crawlers-only
--html-custom-css=<path.css>
--html-custom-js=<path.js>
--html-report-title=<title>
--html-prefs=<JSON>
--json-pretty-print
--max-items=<num>
--no-color
--no-column-names
--no-csv-summary
--no-progress
--no-tab-scroll
--no-html-last-updated
服务器选项 #
--addr=<address>
--daemonize
--origin=<url>
--port=<port>
--real-time-html
--ws-url=<[scheme://]url[:port]>
--fifo-in=<path/file>
--fifo-out=<path/file>
--ssl-cert=<path/cert.crt>
--ssl-key=<path/priv.key>
文件选项 #
-f --log-file=<logfile>
-l --log-debug=<filename>
-p --config-file=<configfile>
--invalid-requests=<filename>
--no-global-config
解析选项 #
-a --agent-list
-d --with-output-resolver
-e --exclude-ip <IP|IP-range>
-H --http-protocol=<yes|no>
-M --http-method=<yes|no>
-o --output=<json|csv>
-q --no-query-string
-r --no-term-resolver
--444-as-404
--4xx-to-unique-count
--all-static-files
--date-spec=<date|hr>
--double-decode
--enable-panel=<PANEL>
--hour-spec=<hour|min>
--ignore-crawlers
--ignore-panel=<PANEL>
--ignore-referer=<referer>
--ignore-status=<STATUS>
--num-tests=<number>
--process-and-exit
--real-os
--sort-panel=<PANEL,FIELD,ORDER>
--static-file <extension>
地理位置选项 #
-g --std-geoip
--geoip-database <geocityfile>
其他选项 #
-h --help
-V --version
-s --storage
--dcf
磁盘存储选项 #
--keep-db-files
--load-from-disk
--db-path <dir>
--xmmap <num>
--cache-lcnum <num>
--cache-ncnum <num>
--tune-lmemb <num>
--tune-nmemb <num>
--tune-bnum <num>
--compression <zlib|bz2>
操作热键 #
F1 或 h主帮助页面。
F5重绘主窗口。
q退出程序,当前窗口或者崩溃了的模块。
o 或 ENTER扩展选中的模块或打开窗口。
0-9 和 Shift + 0激活选中的模块。
j在已扩展模块中向下滚动。
k在已扩展模块中向上滚动。
c设置或者改变配色方案。
^ f在当前模块中向前滚动一屏。
^ b在当前模块中向后滚动一屏。
TAB切换模块(向前)。
SHIFT + TAB切换模块(向后)。
s给活跃模块的选项排序。
/在所有模块中搜索(支持正则)。
n找到下次发生事件的位置。
g移动到第一个选项或者屏幕顶部。
G移动到第最后一个选项或者屏幕底部。
示例 #
日志文件路径指定:
goaccess -f /var/log/nginx/access.log`
配置文件指定:
goaccess -f /var/log/nginx/access.log -p /etc/goaccess/goaccess.conf
输出格式选择:
goaccess -f /var/log/nginx/access.log -o /var/www/html/report.html
实时HTML报告生成:
goaccess -f /var/log/nginx/access.log -o /var/www/html/report.html --real-time-html --daemonize
IP解析:
goaccess -f /var/log/nginx/access.log -d
守护进程模式:
goaccess --daemonize --real-time-html
请求参数忽略:
goaccess -q -f /var/log/nginx/access.log
控制面板鼠标支持:
goaccess -m -f /var/log/nginx/access.log
