logstash-filter-kv icon indicating copy to clipboard operation
logstash-filter-kv copied to clipboard

respect escaped quotes in the valueRxString regex

Open beniwohli opened this issue 9 years ago • 4 comments

This resolves #2. The regex proposed in https://github.com/logstash-plugins/logstash-filter-kv/issues/2#issuecomment-137837605 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.

beniwohli avatar Mar 09 '16 12:03 beniwohli

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'.

elasticsearch-release avatar Mar 09 '16 12:03 elasticsearch-release

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.

beniwohli avatar Apr 20 '16 14:04 beniwohli

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?

jordansissel avatar Jun 08 '16 23:06 jordansissel

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 )

beniwohli avatar Jun 09 '16 08:06 beniwohli