TIL

I love fail2ban but I don't want to test my failregex on the live server. It turns out this is not necessary because:

  1. there's a native fail2ban-regex tool that we can use to test both configurations and log files:
$ fail2ban-regex -v path/to/mock/log/file.log path/to/my/fail2ban/app.conf

This will print matches and what not.

  1. fail2ban simply uses the Python's regex library, so we can go for example to regex101.com, select Python and play there, and only after confirming everything works there we can do a final check with 1..

Source: