waterye

awk分析access log

awk '{ if (index($4,"ip")>0) { split($4,a,","); if (substr(a[2],11)>0) print substr(a[2],11) } }' access.log.txt.2008-07-26 > ip.20080726.log
awk '{a[$0]++}END{for(i in a){print a[i] " " i}}' ip.20080726.log | sort -rn | head -n 300
awk '{a[$0]++}END{for(i in a){ j++;} } END { print j }' ip.20080726.log

The GNU Awk User's Guide

posted on 2008-07-27 01:18 waterye 阅读(443) 评论(0)  编辑  收藏 所属分类: Linux


只有注册用户登录后才能发表评论。


网站导航: