Skip to content
This repository was archived by the owner on Aug 8, 2024. It is now read-only.
This repository was 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

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions