I read a little more and continued to draw events with grok, adding a tag and discarding them at the end if the tag was not there:
filter { grok { add_tag => [ "valid" ] match => [ "message", ".+ \[critical\]: ?(.+)", "message", ".+ \[crit\]: ?(.+) ", "message", '.+ (Deadlock found.+) ', "message", "(.+: Could not record email: .+) " ] } if "valid" not in [tags] { drop { } } mutate { remove_tag => [ "valid" ] } }
source share