最後更新: 2015-06-09
介紹
HomePage: http://goaccess.io/
另一個類似 apachetop 的工具, 功能更強大:
- 它有 terminal UI 及 browser UI (Web Socket server)
- written in C
- Real Time(200 ms)
- Only ncurses as a dependency
目錄
Install
# epel (C7, R8)
yum install goaccess
Usage
Terminal Output
i.e.
1) goaccess access.log
+---------------------------------------------------------------------+ | Log Format Configuration | | [SPACE] to toggle - [ENTER] to proceed - [q] to quit | | | | [ ] NCSA Combined Log Format | | [ ] NCSA Combined Log Format with Virtual Host | | [ ] Common Log Format (CLF) | | [ ] Common Log Format (CLF) with Virtual Host | | [ ] W3C | | [ ] CloudFront (Download Distribution) | | | | Log Format - [c] to add/edit format | | | | | | Date Format - [d] to add/edit format | | | | | | Time Format - [t] to add/edit format | | | +---------------------------------------------------------------------+
2) 設定 logformat: COMMON, COMBINED
goaccess --log-format=COMMON access.log > report.html
goaccess -o report.html --log-format=COMBINED access.log
Hotkey
F5: Redraw
1 - Unique visitors per day - Including spiders
2 - Requested Files (URLs)
3 - Static Requests (ie. /favicon.ico)
4 - Not Found URLs (404s)
5 - Visitor Hostnames and IPs
6 - Operating Systems
7 - Browsers8
8 - Time Distribution
Static HTML Output
goaccess access.log -o report.html --log-format=COMBINED
Real-Time HTML Output
# WebSocket Server (it pushes the latest data to the browser)
goaccess access.log -o /var/www/html/report.html --log-format=COMBINED --real-time-html
更改 Time Distribution slot
Time Distribution
This is used in the time distribution panel. It's useful for tracking peaks of traffic on your server at specific times.
--hour-spec=<hour|min>
Set the time specificity to either hour (default) or min to display the tenth of an hour appended to the hour.