1. 通过 wvanbergen-request-log-analyzer
安装:
gem sources -a http://gems.github.com
sudo gem install wvanbergen-request-log-analyzer
$ request-log-analyzer /var/log/my_app.log
可以分析大多内容,例如:
Top 10 most requested actions
Top 10 actions by time – cumulative
Top 10 actions by time – per request mean
Top 10 worst DB offenders – cumulative time
Top 10 worst DB offenders – mean time
Requests graph – per hour
2, 得到独立IP数量
cat production.log | grep “^Processing” | awk ‘{print $4}’ | uniq | wc -l
3, 每个IP的访问次数
cat production.log | grep “^Processing” | awk ‘{print $4}’ | uniq -c
4, 得到网站所有访问数量
cat production.log | grep “^Processing” |wc |awk ‘{print $1}’
5, 统计每个页面的各自访问次数
cat production.log |grep “200 OK” | awk ‘{print $17}’ | sort | uniq -c
安装:
gem sources -a http://gems.github.com
sudo gem install wvanbergen-request-log-analyzer
$ request-log-analyzer /var/log/my_app.log
可以分析大多内容,例如:
Top 10 most requested actions
Top 10 actions by time – cumulative
Top 10 actions by time – per request mean
Top 10 worst DB offenders – cumulative time
Top 10 worst DB offenders – mean time
Requests graph – per hour
2, 得到独立IP数量
cat production.log | grep “^Processing” | awk ‘{print $4}’ | uniq | wc -l
3, 每个IP的访问次数
cat production.log | grep “^Processing” | awk ‘{print $4}’ | uniq -c
4, 得到网站所有访问数量
cat production.log | grep “^Processing” |wc |awk ‘{print $1}’
5, 统计每个页面的各自访问次数
cat production.log |grep “200 OK” | awk ‘{print $17}’ | sort | uniq -c
本文介绍了一种使用wvanbergen-request-log-analyzer分析应用程序日志的方法,并提供了几个实用的shell命令来统计独立IP数量、每个IP的访问次数、总访问量及各页面访问次数等关键信息。
177

被折叠的 条评论
为什么被折叠?



