mel
mel

Reputation: 2790

Having multiple output using Logstash

I am new to Logstash and I have trouble understanding how to configure the following process:

Let's say I want to have my logstash collecting Tweets and simultaneously indexing the tweets in my ES and store the tweet in a MongoDB?

I succeed to have my log stash collecting tweets and indexing it in a ES but I don't know how to configure it to store the tweets in my mongoDB as well?

Is it possible? How to configure it?

Upvotes: 0

Views: 274

Answers (1)

Joanna Mamczynska
Joanna Mamczynska

Reputation: 2208

It's possible, you can configure multiple plugins in the output section of conf file:

output
{
    stdout {
        codec => rubydebug
    }

    elasticsearch {
        hosts => ["my-elasticsearch:9200"]
        index => "logs"
        document_type => "applog"
    }

    mongodb
    {
        isodate => true
        database => "metrics"
        collection => "logs"        
        uri => "mongodb://127.0.0.1:27017"
    }
}

Check logstash documentation for all available mongodb options as this may vary depending on logstash version (collection, database and uri are required).

Upvotes: 3

Related Questions