http://www.webta.org/projects/apachetop/
Apachetop is a curses-based top-like display for Apache information, including requests per second, bytes per second, most popular URLs, etc.
Apachetop watches a logfile generated by Apache (in standard common or combined logformat, although it doesn't (yet) make use of any of the extra fields in combined) and generates human-parsable output in realtime.
安装很简单
#yum -y install readline-devel
# wget http://www.webta.org/apachetop/apachetop-0.12.6.tar.gz
# tar xzvf apachetop-0.12.6.tar.gz
# cd apachetop-0.12.6
# ./configure
# make
# make install
分析查看日志的时候
apachetop -f access.log
下面是用法说明:
File options:
-f logfile open logfile (assumed common/combined) [/var/log/httpd-access.log]
(repeat option for more than one source)
URL/host/referrer munging options:
-q 保持请求字符串[no]
-l 所有的url小写[no]
-s num 保持url路径段数量 [all]
-p 在referrer前面保留协议 [no]
-r 保留每一个的主机/ip [no]
Stats options:
必须提供两个参数 default: [-T 30]
缺省设置为保持记录状态30秒,30秒后数据刷新了。为了提供更多的信息给我们分析,我们可以调节下面的参数。
-H hits 保持状态只到多少点击数
-T secs 保持状态只到多少秒
-d secs 刷新延迟时间[5]
-h 这个帮助。
当执行之后,还有命令可以切换显示状态:
ONE-TOUCH COMMANDS
d : 切换urls/referrers/hosts显示模式开关
n : 切换hits & bytes或返回代码开关
h or ? : 帮助信息
p : (un)暂停显示 (冻结更新)
q : 退出 ApacheTop
up/down : 移动星标 up/down
right/left : 进入/退出逐条显示模式
子菜单:
s: 排序: [the appropriate menu will appear for your display]
r) requests R) reqs/sec b) bytes B) bytes/sec
2) 2xx 3) 3xx 4) 4xx 5) 5xx
t: 固定显示 ON/OFF:
u) urls r) referrers h) hosts
f: 使用过滤器:
a) add/edit menu c) clear all s) show active (not done yet)
a: ADD FILTER SUBMENU
u) to urls r) to referrers h) to hosts