logstash-plugins / logstash-filter-kv

Apache License 2.0
17 stars 42 forks source link

Add `field_split_char` and `value_split_char` that properly do escaping. #66

Open yaauie opened 6 years ago

yaauie commented 6 years ago

Injecting verbatim input from field_split and value_split directives into character classes is prone to user error, requiring our users know which characters are meaningful in the regexp context and properly escaping them in their pipeline configs.

When config.support_escapes is enabled, users need to double-escape, which makes things extra tricky.

This ticket is to add two new directives (field_split_char and value_split_char), which will properly escape inputs before generating the character classes.

colinsurprenant commented 6 years ago

@yaauie good idea. maybe we could allow field_split_char to be an array of chars, so if you need to specify multiple chars in the character classes then this will work. It could completely replace the field_split option eventually too.