Update mongodb.rb

Fix for LOGSTASH-1371
This commit is contained in:
bitsofinfo 2013-09-20 11:39:41 -04:00
parent d5259cd6a7
commit fc40f9ca03

View file

@ -37,7 +37,9 @@ class LogStash::Outputs::Mongodb < LogStash::Outputs::Base
conn = uriParsed.connection({})
if uriParsed.auths.length > 0
uriParsed.auths.each do |auth|
conn.add_auth(auth['db_name'], auth['username'], auth['password'])
if !auth['db_name'].nil?
conn.add_auth(auth['db_name'], auth['username'], auth['password'], nil)
end
end
conn.apply_saved_authentication()
end