From f47ff95b8edbcf954899b3d663cc0c5e7d1c6bc4 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Mon, 6 Jan 2014 08:47:39 +1100 Subject: [PATCH] BF: datepattern for fail2ban-regex --- bin/fail2ban-regex | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/fail2ban-regex b/bin/fail2ban-regex index fc39c958..014bfb2f 100755 --- a/bin/fail2ban-regex +++ b/bin/fail2ban-regex @@ -297,6 +297,14 @@ class Fail2banRegex(object): pass else: self.setJournalMatch(shlex.split(journalmatch)) + # Read out and set possible value for journalmatch + try: + datepattern = reader.get("Init", "datepattern") + except (NoSectionError, NoOptionError): + # No [Init].datepattern found. + pass + else: + self.setDatePattern(datepattern) else: print "Use %11s line : %s" % (regex, shortstr(value)) regex_values = [RegexStat(value)]