Discard non matching pattern from logfile through LOGSTASH

128 Views Asked by At

I am wondering what the best approach to take with my Logstash Grok filters. I have some filters that are for specific log entries, and won't apply to all entries. The ones that don't apply always generate _grokparsefailure tags. For example, I have one grok filter that's for every log entry and it works fine.

Logstash parses other unwanted log lines which are not required.

I'd prefer to have it just pass the rule if there isn't a match instead of adding the parsefailure tag. I use the parsefailure tag to find things that aren't parsing properly, not things that simply didn't match a particular filter. Maybe it's just the nomenclature "parse failure" that gets me. To me that means there's something wrong with the filter (e.g. badly formatted), not that it didn't match.

1

There are 1 best solutions below

0
Badger On

If you want some grok filters to add _grokparsefailure and not others then for the latter type use

tag_on_failure => []