I have a log file with lines that look like this:
2019-12-21 20:30:02 index [WARNING]: authenticate: failed login attempt {"action":"login","username":"tgbtgbtgbtgb","ip":"61.142.184.152"} - {"file":"Login.php","line":147, ...
I set up a filter in Fail2ban with the following regex:
\"%Y-%m-%d %H:%M:%S\" index [WARNING]: authenticate: failed login attempt {\"action\":\"login\",\"username\":\".*\",\"ip\":\"<HOST>\".*
Unfortunately, Fail2ban can't catch the failed log in attempts based on the regex above. What can be wrong ?
The configuration block in /etc/fail2ban/jail.local is:
[appname]
enabled = true
filter = appname
logpath = /path/to/logfile.log
port = 80,443
maxretry = 3
bantime = 259200
Also, the log file is readable by Fail2ban. Thank you for your help!