logstash-plugins / logstash-filter-kv

Apache License 2.0
17 stars 42 forks source link

Add `whitespace => strict` mode #67

Closed yaauie closed 6 years ago

yaauie commented 6 years ago

When configured with a space for its field_split (as is default), the leniency in acceptance of optional spaces surrounding the value_split prevents the parser from being able to detect an unquoted "empty" field.

By adding an opt-in whitespace mode that is strict and does not allow unnecessary whitespace, we enable users who behave in this strict manner to specify "null" or "empty" fields in their events.


This PR also includes a net-no-op refactor in a separate commit that simplifies the generated regexp, reducing the reliance of complex lookahead assertions and teasing apart the support for optional whitespace sequences vs use of space as a field_split.


Resolves #65 Resolves #37

colinsurprenant commented 6 years ago

LGTM - great work @yaauie!