Skip to content

respect escaped quotes in the valueRxString regex#27

Open
beniwohli wants to merge 1 commit into
logstash-plugins:mainfrom
beniwohli:issue-2
Open

respect escaped quotes in the valueRxString regex#27
beniwohli wants to merge 1 commit into
logstash-plugins:mainfrom
beniwohli:issue-2

Conversation

@beniwohli

Copy link
Copy Markdown

This resolves #2. The regex proposed in #2 (comment) turned out to not work correctly, and it was extremely slow (the test suite never finished). Instead, I adapted the regex from http://stackoverflow.com/a/10786066/45691. Here's the regex on regexdoc: https://regex101.com/r/wN6qS3/1.

@ghost

ghost commented Mar 9, 2016

Copy link
Copy Markdown

Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run; then say 'jenkins, test it'.

@beniwohli

Copy link
Copy Markdown
Author

Is there any interest in this PR? I'll gladly spend the time to fix the merge conflicts that have accrued since opening it, but only if there's interest in merging it.

@jordansissel

Copy link
Copy Markdown
Contributor

Howdy! Sorry for the delays.

I like the idea as proposed. I have a question about the behavior, though. It feels like the escaped characters should be interpreted before storing in the event. For example, for a kv input of this:

foo="hello \"world\""

The resulting value for the foo field should be hello "world" (no backslashes). The way I read your tests, it seems like the backslashes are kept. Thoughts?

@beniwohli

Copy link
Copy Markdown
Author

Thanks for the feedback. Yes, you're right, the quoting back slashes shouldn't end up in the resulting string. I'll see if I can tweak the regex (it's been a while since I fully understood that regex, though :D )

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kv filter: support escaped quotes

3 participants