- 论坛徽章:
- 0
|
那不对啊,我还有个疑问!!
[root@cms101 28]# awk -F '[ ?]+' '{a[$7]++}END{for(i in a)printf "%s %d\n",i,a[ i ]}' www_access_log | sort -k2nr | head -5
/ 7985
/img/2007/bg_login.gif 6715
/detailcount/count.aspx 3502
/_vti_bin/owssvr.dll 1995
/MSOffice/cltreq.asp 1956
[root@cms101 28]# awk '{print $7}' www_access_log | sort | uniq -c | sort -nr | head -5
7465 /
6715 /img/2007/bg_login.gif
1868 /&
1563 /rest/text.htm
1552 /lbi-image/homepage/gif9901.gif
这个我知道了,是URL参数的问题!
但是awk -F '[ ?]+' '{a[$7]++}解释不通啊!
[root@rhel401 del]# cat file
1 2 3 4 5
1?2?3?4?5
[root@rhel401 del]# awk -F '[?]+' '{print $1}' file
1 2 3 4 5
1
哪里来的$7呢? |
|