Merge pull request #659 from bitsofinfo/master

Update mongodb.rb w/ fix for LOGSTASH-1371
This commit is contained in:
Nick Ethier 2013-09-20 11:38:34 -07:00
commit beb84ff904

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