apache-log-parser icon indicating copy to clipboard operation
apache-log-parser copied to clipboard

Can't handle format string if there are same multiple values

Open gecube opened this issue 8 years ago • 0 comments

>>> 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 "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/apache_log_parser/__init__.py", line 259, in make_parser
    return Parser(format_string).parse
  File "/usr/local/lib/python2.7/dist-packages/apache_log_parser/__init__.py", line 242, in __init__
    self.log_line_regex = re.compile(self.log_line_regex)
  File "/usr/lib/python2.7/re.py", line 190, in compile
    return _compile(pattern, flags)
  File "/usr/lib/python2.7/re.py", line 244, in _compile
    raise error, v # invalid expression
sre_constants.error: redefinition of group name 'remote_ip' as group 11; was group 2

It is totally correct apache ErrorLogFormat string, but the module can't handle it.

gecube avatar Jun 27 '17 10:06 gecube