-
Notifications
You must be signed in to change notification settings - Fork 22
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
Handling of literal double quotes #10
Comments
Logstash syntax doesn't support escapes the way you are trying to use them. I recommend using single quotes.
|
Might be helpful to document in dissect filter section for users rewriting their configs from grok to dissect because grok appears to handle this just fine.
Returns:
|
That is unexpected behavior and a bug, and I don't want us to document a bug as if it were a feature. It works by accident because the regex compiler seems to turn In Ruby, we can see them being identical expressions:
|
Thanks for the explanation ❤️ Sounds good then! We do have it documented in this issue so it will suffice. |
Maybe instead of focusing the documentation on quotation marks, we could highlight that the regex engine does additional processing when compiling the pattern. This idea is much more than just Another example of something wildly different in dissect and grok is this pattern:
In Grok, this becomes compiled (regex) to mean "match a single character that can by any of h, e, l, or o". In Dissect, this means literally match the text "[hello]". And another example:
In Grok, this means "any character". In Dissect, this means "a period". |
This sounds like a good idea :) |
@ppf2 thank you for filing. Sometimes it's easy to forget how similar ideas are (grok/dissect) and how different the implementations and effects are ;) |
Example log entry:
If I use the dissect mapping:
Fields will not get extracted because Logstash does not currently handle double quotes semantics yet.
The following works but will generate fields with literal double quotes in them:
eg.
"supportID" => ""4394740425750718628""
Possible workarounds will be to pre-process the log entry to either remove the literal double quotes via a gsub, or reformat the log entry using one of the workarounds in the elastic/logstash#1645 ticket.
For users who are switching from grok to dissect, it may be helpful to document this use case in a reference/caveat section.
The text was updated successfully, but these errors were encountered: