日志格式:
192.168.10.234 - - [24/Sep/2009:10:35:58 +0800] "GET /svnroot/platform/branches/1.0sp1/operator HTTP/1.1" 401 470 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.2; MAXTHON 2.0)"
命令:
cat svn_access.log |awk '{print $1}'|sort|uniq -c|sort -nr|head -n 10
方法二:
cat svn_access.log |awk '{++S[$1]} END {for (i in S) print "IP:" i,"COUNT:" S[i]}'|sort -t: -nr -k3|head -n 10
阅读(2546) | 评论(0) | 转发(0) |