apache-log-parser
apache-log-parser copied to clipboard
Parses log lines from an apache log
Changed the timezone reading logic part and created a test that would fail on original code but will run fine with my change.
>>>import apache_log_parser >>>line_parser = apache_log_parser.make_parser("%t") >>>data = line_parser("[16/Aug/2013:15:45:34 +0435]") >>>data {'time_received': '[16/Aug/2013:15:45:34 +0435]', 'time_received_datetimeobj': datetime.datetime(2013, 8, 16, 15, 45, 34), 'time_received_isoformat': '2013-08-16T15:45:34', 'time_received_tz_datetimeobj': datetime.datetime(2013, 8, 16, 15, 45, 34, tzinfo='0435'),...
Hi, I can't get the apache_log_parser to run under python 2.6.6 (I'm stuck on RHEL), I get a syntax error on line 69 of the parsers.py file. It appears to...
``` >>> line_parser=apache_log_parser.make_parser('%V %a [%{u}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% ,\ referer\ %{Referer}i"') Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/apache_log_parser/__init__.py", line...
The make_parser() function is unable to parse ISO 8601 `2017-03-12T01:00:08+00:00`