How to get list of all IP addresses unbanned today by Fail2ban

List of all IP addresses unbanned today by Fail2ban:

$ sudo zgrep -h "Unban " /var/log/fail2ban.log* | grep `date +%Y-%m-%d` | awk '{print $NF}' | sort | uniq -c

To sort in ascending order by count of unbanned, use below command

$ sudo zgrep -h "Unban " /var/log/fail2ban.log* | grep `date +%Y-%m-%d` | awk '{print $NF}' | sort | uniq -c | sort -n

List of all IP addresses unbanned today by Fail2ban, grouped by IP address and Hostname:

Logresolve command is not installed by default, you have to install logresolve before running this command

$ sudo zgrep -h "Unban " /var/log/fail2ban.log* | grep `date +%Y-%m-%d` | awk '{print $NF}' | sort | awk '{print $1,"("$1")"}' | logresolve | uniq -c

To sort in ascending order by count of unbanned, use below command

$ sudo zgrep -h "Unban " /var/log/fail2ban.log* | grep `date +%Y-%m-%d` | awk '{print $NF}' | sort | awk '{print $1,"("$1")"}' | logresolve | uniq -c | sort -n

If you want to get list of all IP addresses ever banned by Fail2ban, then please visit How to get list of all IP addresses unbanned by Fail2ban

More more ways to analyse Fail2ban logs, please visit Fail2ban Log Analysis