Conditional Filebeat output based on document type


Currently I have filebeat on a server with multiple different application logs, so I have multiple prospectors grabbing and tagging the different application logs. The logs have different formats so one of them needs to be sent to logstash for filtering will the others are json so they can go directly to Elasticsearch.

My question is, is there a way to ensure the one log that needs filtering is only sent to logstash, not elasticsearch, and the logs that do not need filtering are sent only to Elasticsearch and not logstash. Currently I have something like this for my elasticsearch output

  • index: "audience_backend-%{+yyyy.MM.dd}"
    type: "audience_backend"
  • index: "audience_exceptions-%{+yyyy.MM.dd}"
    type: "audience_exceptions"

The issue being is the third log that has a different type is still sent to Elasticsearch under the default filebeat index even though it does not match either of the above.

Conditional index + pipeline in output?
(Noémi Ványi) #2

You need to filter out the third log which has a different type.
You could use a processor to drop those unwanted events. (Assuming it is what you want to do with messages not matching anything.)
More on processors:

Let me know if you need further help.

(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.