Use a grok filter that only matches and extracts fields from this exact kind of message. If a line doesn't match it'll get tagged ẁith _grokparsefailure
. You can then look for that tag in a conditional that wraps a drop filter (see How to exclude bad output (lines not matching 'grok' pattern) from logstash? for an example).