jordansissel / ruby-grok

Pure-ruby implementation of grok.
Apache License 2.0
54 stars 25 forks source link

Don't do coerce operation if match is nil #20

Closed jsvd closed 9 years ago

jsvd commented 9 years ago

closes https://github.com/elastic/logstash/issues/2897

@suyograo originally proposed another fix for https://github.com/elastic/logstash/issues/2897, that is composed by:

19 and https://github.com/logstash-plugins/logstash-filter-grok/pull/20

suyograo commented 9 years ago

@jsvd I did #19 because there is a keep_empty_values option that needs to be respected from Logstash. So we need to return both the original value and the coerced value so the caller (Logstash) can make the call based on the option is set or not.

We could push the option upstream to grok but that's a more disruptive change.

jsvd commented 9 years ago

This change is compatible with keep_empty_values since Logstash does it by checking if the match value is nil. So no other change is necessary.

suyograo commented 9 years ago

LGTM