cat somelog.log |grep POST|awk '{print $1}'|sort |uniq -c|sort -rn|awk '{if ($1>1000) system("iptables -I INPUT -s "$2" -j DROP")}'
grep log and block
Leave a reply
cat somelog.log |grep POST|awk '{print $1}'|sort |uniq -c|sort -rn|awk '{if ($1>1000) system("iptables -I INPUT -s "$2" -j DROP")}'