ENH+TST: Add Apache Tomcat date format

pull/176/head
Steven Hiscocks 2013-04-16 21:09:53 +01:00
parent 5aef036f54
commit c6bd8fc807
2 changed files with 7 additions and 0 deletions

View File

@ -161,6 +161,12 @@ class DateDetector:
template.setRegex("^\d{2}\d{2}\d{2} +\d{1,2}:\d{2}:\d{2}")
template.setPattern("%y%m%d %H:%M:%S")
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:
self.__lock.release()

View File

@ -86,6 +86,7 @@ class DateDetectorTest(unittest.TestCase):
"2005-01-23T21:59:59-05:00Z", #ISO 8601 with TZ
"<01/23/05@21:59:59>",
"050123 21:59:59", # MySQL
"Jan 23, 2005 9:59:59 PM", # Apache Tomcat
):
log = sdate + "[sshd] error: PAM: Authentication failure"
# exclude