- 论坛徽章:
- 0
|
统计出每个小时内超时($6 >100000 )的访问量,日志格式如下:
139.42.236.199 - - 2011-05-29 00:41:53 103090 "POST "Java/1.6.0_21"
149.42.236.203 - - 2011-05-29 00:42:53 126681 "POST "Java/1.6.0_21"
169.46.236.201 - - 2011-05-29 00:47:53 168740 "POST "Java/1.6.0_21"
179.45.236.199 - - 2011-05-29 02:41:53 103090 "POST "Java/1.6.0_21"
119.43.236.203 - - 2011-05-29 02:42:53 126681 "POST "Java/1.6.0_21"
189.42.236.201 - - 2011-05-29 04:47:53 168740 "POST "Java/1.6.0_21"
149.42.236.199 - - 2011-05-29 11:41:53 103090 "POST "Java/1.6.0_21"
我的想法是split $5,然后uniq wc一下,但是脚本好像不工作,请高手帮忙看一下,或者求简便写法:
grep forecasting access_log_0529 |awk '{ if ( $6 > 1000000) { split( $5,myarry,":" ) {print myarry[1] } }{print $6 }}' |uniq -c |wc -l |
|