Prevent errors when parsing date on malformed lines
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.
Showing
apachedex/tests.py
0 → 100644
Please register or sign in to comment