Logstash RabbitMQ input plugin - How to define multiple routing_key

I'm using RabbitMQ plugin of Logstash to pull from RabbitMQ and push to Elasticsearch using this pipeline:

input {
    rabbitmq {
        queue => "Elasticsearch_Queue"
        host => "rabbitmq"
        exchange => "my_event_bus"
        key => "SomeIntegrationEvent" # How to define multiple keys?
    }
}
output {
    elasticsearch {
        hosts => [ "elasticsearch:9200" ]
    }
    stdout { codec => rubydebug }
}

It works fine and creates a queue named Elasticsearch_Queue and binds to my_event_bus exchange using routing_key SomeIntegrationEvent .

I need to subscribe to multiple events but there is no clear solution on the plugin docs.

The value key is a string and you cannot use the syntax like ["key1","key2"]
Try the following way:

input {
    rabbitmq {
        queue => "Elasticsearch_Queue"
        host => "rabbitmq"
        exchange => "my_event_bus"
        key => "SomeIntegrationEvent1" 
    }
    rabbitmq {
        queue => "Elasticsearch_Queue"
        host => "rabbitmq"
        exchange => "my_event_bus"
        key => "SomeIntegrationEvent2" 
    }
}

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