mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-20 06:08:35 +02:00
Merge pull request #3641 from modoboa/logparser_new_date_format
Support dates without high-precision part.
This commit is contained in:
@@ -78,6 +78,7 @@ class LogParser:
|
||||
# set up regular expression
|
||||
self._date_expressions = [
|
||||
r"(?P<month>\w+)\s+(?P<day>\d+)\s+(?P<hour>\d+):(?P<min>\d+):(?P<sec>\d+)(?P<eol>.*)", # noqa
|
||||
r"(?P<year>\d+)-(?P<month>\d+)-(?P<day>\d+)T(?P<hour>\d+):(?P<min>\d+):(?P<sec>\d+)[\+\-]\d+:\d+(?P<eol>.*)", # noqa
|
||||
r"(?P<year>\d+)-(?P<month>\d+)-(?P<day>\d+)T(?P<hour>\d+):(?P<min>\d+):(?P<sec>\d+)\.\d+[\+\-]\d+:\d+(?P<eol>.*)", # noqa
|
||||
]
|
||||
self._date_expressions = [re.compile(v) for v in self._date_expressions]
|
||||
|
||||
Reference in New Issue
Block a user