From 9e2a4a935aa27e9204de8c94e1af83b8c016cee8 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Tue, 12 Aug 2008 21:42:21 +0000 Subject: [PATCH] - Added date template for Day-Month-Year Hour:Minute:Second. - Values as string are shown in capital in the description. git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@710 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- server/datedetector.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/server/datedetector.py b/server/datedetector.py index 580c99e8..0f18cf98 100644 --- a/server/datedetector.py +++ b/server/datedetector.py @@ -43,19 +43,19 @@ class DateDetector: try: # standard template = DateStrptime() - template.setName("Month Day Hour:Minute:Second") + template.setName("MONTH Day Hour:Minute:Second") template.setRegex("^\S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2}") template.setPattern("%b %d %H:%M:%S") self.__templates.append(template) # asctime template = DateStrptime() - template.setName("Weekday Month Day Hour:Minute:Second Year") + template.setName("WEEKDAY MONTH Day Hour:Minute:Second Year") template.setRegex("\S{3} \S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2} \d{4}") template.setPattern("%a %b %d %H:%M:%S %Y") self.__templates.append(template) # asctime without year template = DateStrptime() - template.setName("Weekday Month Day Hour:Minute:Second") + template.setName("WEEKDAY MONTH Day Hour:Minute:Second") template.setRegex("\S{3} \S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2}") template.setPattern("%a %b %d %H:%M:%S") self.__templates.append(template) @@ -73,7 +73,7 @@ class DateDetector: self.__templates.append(template) # Apache format [31/Oct/2006:09:22:55 -0000] template = DateStrptime() - template.setName("Day/Month/Year:Hour:Minute:Second") + template.setName("Day/MONTH/Year:Hour:Minute:Second") template.setRegex("\d{2}/\S{3}/\d{4}:\d{2}:\d{2}:\d{2}") template.setPattern("%d/%b/%Y:%H:%M:%S") self.__templates.append(template) @@ -85,10 +85,16 @@ class DateDetector: self.__templates.append(template) # named 26-Jul-2007 15:20:52.252 template = DateStrptime() - template.setName("Day-Month-Year Hour:Minute:Second[.Millisecond]") + template.setName("Day-MONTH-Year Hour:Minute:Second[.Millisecond]") template.setRegex("\d{2}-\S{3}-\d{4} \d{2}:\d{2}:\d{2}") template.setPattern("%d-%b-%Y %H:%M:%S") self.__templates.append(template) + # 17-07-2008 17:23:25 + template = DateStrptime() + template.setName("Day-Month-Year Hour:Minute:Second") + template.setRegex("\d{2}-\d{2}-\d{4} \d{2}:\d{2}:\d{2}") + template.setPattern("%d-%m-%Y %H:%M:%S") + self.__templates.append(template) # TAI64N template = DateTai64n() template.setName("TAI64N")