#ͳapache cookie logзƵߵ20ipͷʴ
cat cookielog | awk '{ a[$1] += 1; } END { for(i in a) printf("%d, %s\n", a[i], i ); }' | sort -n | tail -20

#ͳapache cookie logз404urlб
awk '$11 == 404 {print $8}' access_log | uniq -c | sort -rn | head

#ͳһipʳ20εipͷʴб$1ΪurlӦ$9,ͳÿurlķʴ
cat access_log | awk '{print $1}' | sort | uniq -c | sort -n | awk '{ if ($1 > 20)print $1,$2}'

#ͳÿurlƽʱ
cat cookielog | awk '{ a[$6] += 1; b[$6] += $11; } END { for(i in a) printf("%d, %d, %s\n", a[i],a[i]/b[i] i ); }' | sort -n | tail -20


#ӡapacheipб
tail -f access.log | awk -W interactive '!x[$1]++ {print $1}'

#ͨ־鿴ָipʴurlͷʴ:
cat access.log | grep "10.0.21.17" | awk '{print $7}' | sort | uniq -c | sort Cnr


#ͨ־鿴ʴʱ
awk '{print $4}' access.log | grep "26/Mar/2012" |cut -c 20-50|sort|uniq -c|sort -nr|head

#鿴ĳһķ
cat access_log|grep '12/Nov/2012'|grep "******.htm"|wc|awk '{print $1}'|uniq 

#鿴ʱ䳬30msurlб
cat access_log|awk ($NF > 30){print $7}|sort -n|uniq -c|sort -nr|head -20 

#гӦʱ䳬60murlбͳƳִ
cat access_log |awk ($NF > 60 && $7~/\.php/){print $7}|sort -n|uniq -c|sort -nr|head -100 

#ųurlʴ
sed "/Baiduspider/d;/Googlebot/d;/Sogou web spider/d;" xxx.log|awk -F' ' '{print $7}'|sort | uniq -c | sort -k1,2 -nr 

#ͳ/index.htmlҳķuv
grep "/index.html" access.log | cut Cd   Cf 4| sort | uniq | wc Cl 