Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regex_core.error issues when using complex grok patterns using EPEL python-regex-2015.06.24 #5

Closed
trixpan opened this issue Jul 26, 2015 · 2 comments
Labels

Comments

@trixpan
Copy link

trixpan commented Jul 26, 2015

pygrok seems to be having issues processing complex grok patterns such as:

SYSLOGBASE

    match_obj = re.search(py_regex_pattern, text)
  File "/usr/lib64/python2.6/site-packages/regex.py", line 251, in search
    return _compile(pattern, flags, kwargs).search(string, pos, endpos,
  File "/usr/lib64/python2.6/site-packages/regex.py", line 499, in _compile
    caught_exception.pos)
_regex_core.error: bad fuzzy constraint at position 19
@tmessi
Copy link
Contributor

tmessi commented Sep 14, 2015

It seems like the patterns are not being fully replaced. I tried using the COMBINEDAPACHELOG pattern and printed out py_regex_pattern before it is passed to re.search and got:

((%{IPORHOST:clientip} %{USER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] "(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:response} (?:%{NUMBER:bytes}|-)) (?P<referrer>((?>(?<!\\)(?>"(?>\\.|[^\\"]+)+"|""|(?>'(?>\\.|[^\\']+)+')|''|(?>`(?>\\.|[^\\`]+)+`)|``)))) (?P<agent>((?>(?<!\\)(?>"(?>\\.|[^\\"]+)+"|""|(?>'(?>\\.|[^\\']+)+')|''|(?>`(?>\\.|[^\\`]+)+`)|``)))))

tmessi added a commit to tmessi/pygrok that referenced this issue Sep 14, 2015
garyelephant added a commit that referenced this issue Oct 8, 2015
Fix not fully replacing grok pattern to regex. see #5
@garyelephant
Copy link
Owner

Thanks for @shadowfax-chc 's pull request, You helped us a lot! I've merged it.

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

No branches or pull requests

3 participants