#!/bin/bash
for ip in $(tail -n 200 file | sed -r 's/^.*client *(.*)#.*$/\1/' | uniq -c | awk '$1>30{print $2}' | sort | uniq)
do
iptables -I INPUT -s $ip -j DROP
done