I'm struggling to match Fail2Ban's failregex
on Apache logs using only the HTTP return codes. The log format I'm using is below and in that example it's the field showing "200". As long as the other fields (in that format) can be anything else then it's just that field I'm interested in.
66-121-89-14.domain.com - - [14/Apr/2011:14:47:05 +0100] "GET /city/index.html HTTP/1.1" 200 2577 "http://www.domain.com/referrer/" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16"
I think I need something like this.
failregex = ^(?P<host>\S*).*("-" "-"| 502 | 500 | 417 | 416 | 415 | 414 | 413 | 412 | 405 | 403 |
Can a regex aficionado please help ?
How does this do ?
<HOST>.*\" (500|502|...)