awk ‘{IP[$1]++}END{for( i in IP ) print IP[i],i}‘ access.2016-12-09.log |sort -nr > /tmp/ewb.2016-12-09.log
awk ‘{IP[$1]++}END{for( i in IP ) print IP[i],i}‘ access.2016-12-10.log |sort -nr > /tmp/ewb.2016-12-10.log
awk ‘{IP[$1]++}END{for( i in IP ) print IP[i],i}‘ access.2016-12-11.log |sort -nr > /tmp/ewb.2016-12-11.log
awk ‘{IP[$1]++}END{for( i in IP ) print IP[i],i}‘ access.log |sort -nr > /tmp/ewb.2016-12-12.log
awk ‘{IP[$1]++}END{for( i in IP ) print IP[i],i}‘ logs/localhost_access_log.2016-12-10.txt |sort -nr |head -n 130|awk ‘{print $2}‘ >111
for i in `cat 111`;do iptables -I INPUT -s $i -j REJECT ;done
原文地址:http://wangqh.blog.51cto.com/5367393/1881873