I do have an output as shown below. My plan is to get the first column and do a if statement greater than n value it will get the IP second column and drop the connection.
cat file| egrep "invalid|password" | egrep -v "Accepted|preauth" | awk '{print $13}' |sort | uniq -c
6 61.177.172.35
4083 61.177.172.22
3 69.28.94.192
10 80.2.33.180
I can extract the first column and do the if statement but don't know how can attribute the value with a corresponding IP.