# grep Failed /var/log/secure
Apr 8 15:35:24 mail sshd[22704]: Failed password for root from 123.229.34.230 port 55401 ssh2
Apr 8 15:35:29 mail sshd[22704]: Failed password for root from 123.229.34.230 port 55401 ssh2
Apr 8 15:36:02 mail sshd[23126]: Failed password for root from 123.229.34.230 port 55401 ssh2
# fail2ban-regex --print-all-matched /var/log/secure /etc/fail2ban/filter.d/sshd.conf
Lines: 23 lines, 0 ignored, 4 matched, 19 missed
[processed in 0.02 sec]
|- Matched line(s):
| Apr 8 15:35:22 golum sshd[22704]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=someone user=root
| Apr 8 15:35:24 golum sshd[22704]: Failed password for root from 123.229.34.230 port 55401 ssh2
| Apr 8 15:35:29 golum sshd[22704]: Failed password for root from 123.229.34.230 port 55401 ssh2
| Apr 8 15:36:02 golum sshd[22704]: Failed password for root from 123.229.34.230 port 55401 ssh2
and in the fail2ban.log there are findings logged and in this case it was 3 times found and banned
# grep ssh /var/log/fail2ban.log
2018-04-08 15:35:24,892 fail2ban.filter [24678]: INFO [ssh] Found 123.229.34.230
2018-04-08 15:35:29,703 fail2ban.filter [24678]: INFO [ssh] Found 123.229.34.230
2018-04-08 15:36:02,537 fail2ban.filter [24678]: INFO [ssh] Found 123.229.34.230
2018-04-08 15:36:02,796 fail2ban.actions [24678]: NOTICE [ssh] Ban 123.229.34.230