In my logstash setup, I have a chain of three plugins
input plugin > custom plugin 1 > custom plugin 2 > output plugin
In my currently implementation, I have wrapped code of both custom plugins inside begin...rescue block. What I want to achieve is - if there are any exceptions raised, I want to drop that event in a way that it never reaches output plugin.
Is "event.cancel" the best way to achieve this?
I see logstash drop filter using the same - https://github.com/logstash-plugins/logstash-filter-drop/blob/ef8ef65a82dd2227c3f28b15cf1a693ebcce6201/lib/logstash/filters/drop.rb#L42