I am trying to create a fail2ban regex against this string:
[2020-Nov-10 16:13:35] [freepbx_security.NOTICE]: Authentication failure for S from 109.38.128.48 [] []
What I've created so far is this regex:
\[.*\] \[freepbx_security\.NOTICE\]: Authentication failure for .* from <HOST> \[\] \[\]
I've changed the flavor to explicitly make use of Python. Regex101 shows a match, but my fail2ban-regex still fails to observe it.
I have created a test case with a logline in its most basic form and a most simple test against it, but even that fails:
fail2ban-regex 'Authentication failure for S from 109.38.128.48' 'Authentication failure for S from <HOST>'
Running tests
=============
Use failregex line: Authentication failure for S from <HOST>
Use single line: Authentication failure for S from 109.38.128.48
Results
=======
Failregex: 0 total
Ignoreregex: 0 total
Date template hits:
Lines: 1 lines, 0 ignored, 0 matched, 1 missed
[processed in 0.02 sec]
|- Missed line(s):
| Authentication failure for S from 109.38.128.48
if I apply the
If I add the -D switch to fail2ban-regex I get a debuggex URL which shows a complete match. However, Fail2ban claims its still a miss: Link
No matter how much I fiddle with wildcards, fail2ban-regex doesn't match, while the regex does match if I test it on https://regex101.com/. I'm probably overlooking something small and stupid. Is there anybody who can guide me onto the path of enlightenment :)