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

PATH pattern does not combine well with comma delimination #13

Closed
alcinnz opened this issue Feb 23, 2015 · 2 comments
Closed

PATH pattern does not combine well with comma delimination #13

alcinnz opened this issue Feb 23, 2015 · 2 comments

Comments

@alcinnz
Copy link

alcinnz commented Feb 23, 2015

I have a logfile whose lines may include snippets along the line of a=/some/path, b=some/other/path. As an ELK user interested in these logs I would like to parse them with LogStash.

The logstash configuration:

filter {
  grok {
    match => { "message" => "((a=(?<a>%{PATH})?|b=(?<b>%{PATH})?)(,\s)?)+" }
  }
}

when given a=/some/path, b=/some/other/path LogStash gives the output:

{
         "message" => "a=/some/path, b=/some/other/path",
        "@version" => "1",
      "@timestamp" => "2015-02-23T01:57:56.933Z",
            "type" => "stdin",
            "host" => "gallifry",
               "a" => "/some/path,"
}

I expect b to bind to some/other/path:

{
         "message" => "a=/some/path, b=/some/other/path",
        "@version" => "1",
      "@timestamp" => "2015-02-23T01:57:56.933Z",
            "type" => "stdin",
            "host" => "gallifry",
               "a" => "/some/path"
               "b" => "/some/other/path"
}
@alcinnz
Copy link
Author

alcinnz commented Feb 23, 2015

I find that remove all the ?> from the UNIX_PATH pattern fixes this issue.

heymatthew pushed a commit to catalyst/logstash-patterns-core that referenced this issue Feb 23, 2015
If UNIXPATH is set to using the lazy quantifier, then it stops
backtracking correctly when combined with other greedy regexes.

This fixes issue logstash-plugins#13
purbon pushed a commit that referenced this issue Sep 7, 2015
If UNIXPATH is set to using the lazy quantifier, then it stops
backtracking correctly when combined with other greedy regexes.

This fixes issue #13
@purbon
Copy link

purbon commented Sep 7, 2015

Fixed in 06de0c1

@purbon purbon closed this as completed Sep 7, 2015
kares added a commit to kares/logstash-patterns-core that referenced this issue Nov 26, 2020
adapted matching behavior (extracted from logstash-plugins#13)

NOTE: original fix does not really resolve logstash-plugins#13
06de0c1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants