mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
Update mongodb.rb
Fix for LOGSTASH-1371
This commit is contained in:
parent
d5259cd6a7
commit
fc40f9ca03
1 changed files with 3 additions and 1 deletions
|
@ -37,7 +37,9 @@ class LogStash::Outputs::Mongodb < LogStash::Outputs::Base
|
||||||
conn = uriParsed.connection({})
|
conn = uriParsed.connection({})
|
||||||
if uriParsed.auths.length > 0
|
if uriParsed.auths.length > 0
|
||||||
uriParsed.auths.each do |auth|
|
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
|
end
|
||||||
conn.apply_saved_authentication()
|
conn.apply_saved_authentication()
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue