• Jérome Perrin's avatar
    Prevent errors when parsing date on malformed lines · 855cee8e
    Jérome Perrin authored
    We observed lines in our logs where the timestamp field was still
    respecting the timestamp regexp, so the line was not reported as
    invalid, but parsing such timestamp caused a ValueError in
    _matchToDateTime
    
    The beginning of line was:
    127.0.0.1 - - [14/Jul/2017:127.0.0.1 - - [14/Jul/2017:09:41:41 +0200]
    
    Which uses `[14/Jul/2017:127.0.0.1 - - [14/Jul/2017:09:41:41 +0200]` as
    timestamp, so this fail the simple .split() used to separate timestamp
    and timezone.
    
    Added a minimal test case to reproduce this specific problem.
    855cee8e
__init__.py 57.6 KB