Logstash translate filter for multiple fields


I want to drop the logs based on multiple fields.

Below is the content of drop.yml

logstash : '{"info": "drop"}'

e.g. I want to drop the loglines which has contain the "component" : "logstash" and "severity": "info"

I want to do this dynamically.

    translate {
        field => "component"
        destination => "logstat"
        dictionary_path => "/tmp/drop.yml"
    json {
        source => "logstat"
        target => "severity"
    if [target] == "drop" {
        drop { }

The input logline:


This can be done using two translate sections, but I want single source for comparison.

If I want to drop all the logs of a component want to drop based on the condition:


Can anyone please suggest how to proceed?


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