nginx日志中得到访问量最高前10个IP:
cat access.log.10 | awk '{a[$1]++} END {for(b in a) print b" "a[b]}' | sort -k2 -r | head -n 10
访问量统计:每秒最大请求数倒叙排列10个
awk '{S[$4]++};END{for(i in S) {print S[i],i}}' /data/www/logs/newcomment.cntv.cn-access_log | sort -nr | head
统计http状态码:
awk '{S[$9]++};END{for(i in S) {print S[i],i}}' /data/www/logs/bbs.test.com-access_log-20160217 | sort -nr | head