logstash-filter-kv
logstash-filter-kv copied to clipboard
respect escaped quotes in the valueRxString regex
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.
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'.
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.
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?
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 )