We have recently upgraded from Logstash 2.2.4 to Logstash 5.1.1. Previously, we used the following to remove "-" valued attributes:
code => "event.to_hash.keep_if{|k,v| v != '-'}"
The new Event API breaks this code: https://www.elastic.co/guide/en/logstash/5.0/breaking-changes.html#_ruby_filter_and_custom_plugin_developers and leaves us looking for an alternative solution. Is there a way to achieve this same effect with the new Event API?