-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MongoDB connection error - Failed to handshake #88
Labels
Comments
Latest Version |
require "mongo"
require 'rubygems'
mongo_gem_version = Gem.loaded_specs["mongo"].version
puts "MongoDB output plugin gem version", :gem_version => mongo_gem_version.to_s
client = Mongo::Client.new('mongodb://user:****@127.0.0.1:27018')
@db = client.use('database')
# Get a collection
collection = @db['collection']
# Create an array of documents to insert in bulk
documents = [
{ name: 'Document 1', value: 10 },
{ name: 'Document 2', value: 20 },
{ name: 'Document 3', value: 30 }
# Add more documents as needed
]
# Perform the bulk insert
result = collection.insert_many(documents)
# Print the result
puts "Inserted #{result.inserted_count} documents."
# Close the MongoDB connection
client.close MongoDB output plugin gem version |
vitalik-dj
added a commit
to vitalik-dj/logstash-output-mongodb
that referenced
this issue
Apr 19, 2024
The fix is here |
vitalik-dj
added a commit
to vitalik-dj/logstash-output-mongodb
that referenced
this issue
Apr 22, 2024
Fix logstash-plugins#88 failed to handshake error and publish version 3.1.8
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Logstash information:
Please include the following information:
bin/logstash --version
)logstash 8.11.3
DEB
JVM (e.g.
java -version
):If the affected version of Logstash is 7.9 (or earlier), or if it is NOT using the bundled JDK or using the 'no-jdk' version in 7.10 (or higher), please provide the following information:
java -version
)JAVA_HOME
environment variable if set.OS version (
uname -a
if on a Unix-like system):Description of the problem including expected versus actual behavior:
Steps to reproduce:
Please include a minimal but complete recreation of the problem,
including (e.g.) pipeline definition(s), settings, locale, etc. The easier
you make for us to reproduce it, the more likely that somebody will take the
time to look at it.
Provide logs (if relevant):
The text was updated successfully, but these errors were encountered: