How to config Logstash input from MongoDB


(tongwencong) #1

Is this OK?
input {
mongodb {
database => "my_db"
uri => "mongodb://szxtsv12066mgd:27017"
codec => json
}
}

output {
elasticsearch {
hosts => ["127.0.0.1:9201","127.0.0.1:9202"]
}
}


(Mark Walkom) #2

What version of LS are you on?


(tongwencong) #3

logstash-2.1.1


(tongwencong) #4

it confirm :plugin install logstash-input-mongodb
but failure:
D:\Program Files\logstash-2.1.1\bin>plugin install logstash-input-mongodb
io/console not supported; tty will not be manipulated
Validating logstash-input-mongodb
Unable to download data from https://rubygems.org - Errno::ECONNREFUSED: Connect
ion refused - Connection refused (https://api.rubygems.org/latest_specs.4.8.gz)
ERROR: Installation aborted, verification failed for logstash-input-mongodb


(Mark Walkom) #5

Looks like you cannot connect to install the plugin.
However there is no mongodb input plugin for 2.1.1 - https://www.elastic.co/guide/en/logstash/2.1/input-plugins.html


(tongwencong) #6

I try
logstash-2.1.1
logstash-2.1.0

use plugin list comand : therer is no logstash-input-mongodb
how can I do ?


(Mark Walkom) #7

Well from what I can see there was no input like that that we provided going back to 1.5.
So you may have to find a community one that does it.


(system) #8