From d17b415371d14f00c9b24fc3672733b6666fe345 Mon Sep 17 00:00:00 2001 From: sebres Date: Tue, 5 Mar 2013 00:02:39 +0100 Subject: [PATCH 1/2] invalid date recognition, irregular because of sorting template list (sometimes not reproducible by fail2ban-regex, cause will be not sorted) date in following log line (from nginx) will be wrong detected: 2012/10/11 02:37:17 [error] 18434#0: *947 user "test" was not found in "/www/...", client: 192.168.1.5, ... sometimes it is [correct] - 2012/10/11 (%Y/%m/%d) = 1349919861.71 sometimes it is [invalid] - 12/10/11 (%d/%m/%y) = 1349915838.06 and older as now - 1800 seconds (therefore will be not found) solution: regular expression fixed, cause date in log used always after non symbol (\W) character, so r"\d{2}/\d{2}/\d{2}" will be r"(? Date: Mon, 11 Mar 2013 13:52:31 +0100 Subject: [PATCH 2/2] invalid date recognition, irregular because of sorting template list, now via setRegex --- server/datedetector.py | 26 +++++++++++++------------- server/datetemplate.py | 7 +++++-- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/server/datedetector.py b/server/datedetector.py index 6e484449..c013d551 100644 --- a/server/datedetector.py +++ b/server/datedetector.py @@ -55,80 +55,80 @@ class DateDetector: # standard template = DateStrptime() template.setName("MONTH Day Hour:Minute:Second") - template.setRegex("(?