mirror of https://github.com/fail2ban/fail2ban
ENH+TST: Add Apache Tomcat date format
parent
5aef036f54
commit
c6bd8fc807
|
@ -161,6 +161,12 @@ class DateDetector:
|
||||||
template.setRegex("^\d{2}\d{2}\d{2} +\d{1,2}:\d{2}:\d{2}")
|
template.setRegex("^\d{2}\d{2}\d{2} +\d{1,2}:\d{2}:\d{2}")
|
||||||
template.setPattern("%y%m%d %H:%M:%S")
|
template.setPattern("%y%m%d %H:%M:%S")
|
||||||
self._appendTemplate(template)
|
self._appendTemplate(template)
|
||||||
|
# Apache Tomcat
|
||||||
|
template = DateStrptime()
|
||||||
|
template.setName("MONTH Day, Year 12hour:Minute:Second AM/PM")
|
||||||
|
template.setRegex("\S{3}\s{1,2}\d{1,2}, \d{4} \d{1,2}:\d{2}:\d{2} [AP]M")
|
||||||
|
template.setPattern("%b %d, %Y %I:%M:%S %p")
|
||||||
|
self._appendTemplate(template)
|
||||||
finally:
|
finally:
|
||||||
self.__lock.release()
|
self.__lock.release()
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,7 @@ class DateDetectorTest(unittest.TestCase):
|
||||||
"2005-01-23T21:59:59-05:00Z", #ISO 8601 with TZ
|
"2005-01-23T21:59:59-05:00Z", #ISO 8601 with TZ
|
||||||
"<01/23/05@21:59:59>",
|
"<01/23/05@21:59:59>",
|
||||||
"050123 21:59:59", # MySQL
|
"050123 21:59:59", # MySQL
|
||||||
|
"Jan 23, 2005 9:59:59 PM", # Apache Tomcat
|
||||||
):
|
):
|
||||||
log = sdate + "[sshd] error: PAM: Authentication failure"
|
log = sdate + "[sshd] error: PAM: Authentication failure"
|
||||||
# exclude
|
# exclude
|
||||||
|
|
Loading…
Reference in New Issue