全部 #linux apache nginx awk '{a[$1]=a[$1] $10}END{for(i in a)print a[i]/1024/1024"MB",i}' access.log| sort -nr ip_tarffic_bbs.linuxtone.org.20110114 #iis awk '{a[$7]=a[$7] $NF}END{for(i in a)print a[i]/1024/1024"MB",i} ' access.log|排序-nr
全部
- #linux apache nginx
- awk '{a[$1]=a[$1] $10}END{for(i in a)print
a[i]/1024/1024"MB",i}' access.log|排序 -nr
>ip_tarffic_bbs.linuxtone.org.20110114
- #iis
- awk '{a[$7]=a[$7] $NF}END{for(i in a)print
a[i]/1024/1024"MB",i}' access.log|排序 -nr
>ip_tarffic_bbs.linuxtone.org.20110114
特定时间段
- #linux apache nginx
- sed -n
'/[13/1/2011:16:00:00/,/[13/1/2011:19:00:00/p'
access.log|awk '{a[$1]=a[$1] $10}END{for(i in
a) 打印 a[i]/1024/1024"MB",i}' |sort -nr
>ip_tarffic_bbs.linuxtone.org.20110114_16-18
- #iis
- sed -n '/16:00:00/,/19:00:00/p'
access.log|awk '{a[$7]=a[$7] $NF}END{for(i in
a) 打印 a[i]/1024/1024"MB",i}' |sort -nr
>ip_tarffic_bbs.linuxtone.org.20110114_16-18
统计应用访问量
#linux apache nginx
awk '{print $7}' access.log |sort| uniq -c|排序-nr|头-10