统计apache日志独立IP个数

cat access_log | awk '{++S[$1]} END {for(a in S) print a, S[a]}'|sort|wc -l

 

 

第一列是IP列,第四列是时间列

瞬时IP数:cat access_log | grep 'jw_player.html'|awk '{++S[$4]} END {for(a in S) print a, S[a],$1}' | awk '{print $2,$1}' |wc -l

5 [28/Feb/2011:10:19:19
5 [28/Feb/2011:10:19:40
5 [28/Feb/2011:10:19:51
5 [28/Feb/2011:10:22:05
5 [28/Feb/2011:10:22:50
5 [28/Feb/2011:10:25:48
5 [28/Feb/2011:10:26:01
5 [28/Feb/2011:10:45:13
5 [28/Feb/2011:10:50:11
6 [01/Mar/2011:08:25:24
6 [28/Feb/2011:10:03:20
6 [28/Feb/2011:10:25:20
6 [28/Feb/2011:10:25:25
7 [28/Feb/2011:10:14:50

 

 

cat oa-2011-03-03-access.log |grep core/index.jsp| awk '{++S[$4]} END {for(a in S) print a, S[a],$1}' | awk '{print $2,$1}'|sort -n

你可能感兴趣的:(IP,职场,apche,休闲)