I love fail2ban but I don't want to test my failregex on the live server. It turns out this is not necessary because:
- there's a native
fail2ban-regextool 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.
fail2bansimply 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 with1..
Source: