Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

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

Open
gecube opened this issue Jun 27, 2017 · 0 comments
Open

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

gecube opened this issue Jun 27, 2017 · 0 comments

Comments

@gecube
Copy link

gecube commented Jun 27, 2017

>>> 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant