Skip to content
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

logstash mongodb output - wrong number of arguments #64

Open
s-arjun opened this issue Jul 16, 2019 · 4 comments
Open

logstash mongodb output - wrong number of arguments #64

s-arjun opened this issue Jul 16, 2019 · 4 comments
Assignees

Comments

@s-arjun
Copy link

s-arjun commented Jul 16, 2019

Hi,
I am trying to create something similar to data streaming between MySQL and MongoDB, that is MySQL -> MongoDB.

Here's the conf file..

input {
  jdbc {
    jdbc_driver_library => "/usr/share/logstash/mysql-connector-java-5.1.47/mysql-connector-java-5.1.47.jar"
    jdbc_driver_class => "com.mysql.jdbc.Driver"
    jdbc_connection_string => "jdbc:mysql://localhost:3306/foo"
    jdbc_user => "*****"
    jdbc_password => "*****"
    tracking_column => "update_ts"
    use_column_value => true
    statement => "SELECT * FROM foo.foobar where update_ts >:sql_last_value;"
    schedule => "* * * * *"
  }
}

filter {}

output {
  mongodb{
    uri => "mongodb://localhost:27017"
    database => "mongo_foo"
    collection => "logstash_op"
    id => "my_id"
    codec => "json"
    }
}

I use this command to start stash: bin/logstash -f /etc/logstash/conf.d/sample_config.conf
This is the error I get.

Tue Jul 16 15:04:00 IST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.`
`[INFO ] 2019-07-16 15:04:00.870 [Ruby-0-Thread-20: :1] jdbc - (0.005352s) SELECT * FROM kafka.foobar where update_ts >0;`
**`[WARN ] 2019-07-16 15:04:01.397 [[main]>worker2] mongodb - Failed to send event to MongoDB, retrying in 3 seconds {:event=>#<LogStash::Event:0x2e76d513>, :exception=>#<ArgumentError: wrong number of arguments (given 2, expected 0..1)>}`**
`[WARN ] 2019-07-16 15:04:04.416 [[main]>worker2] mongodb - Failed to send event to MongoDB, retrying in 3 seconds {:event=>#<LogStash::Event:0x2e76d513>, :exception=>#<ArgumentError: wrong number of arguments (given 2, expected 0..1)>}

I'm totally new to logstash, so I'm guessing I must be doing something wrong.

PLEASE HELP..!

@s-arjun
Copy link
Author

s-arjun commented Jul 17, 2019

Issue solved when using 3.1.5.
Previously it was 3.1.6.

Same issue as https://github.com/logstash-plugins/logstash-output-mongodb/issues/60

@yaauie yaauie self-assigned this Jul 23, 2019
@YakobovLior
Copy link

Is there any plan to solve this, or an ETA for 3.1.7? I need support of both "isodate" and the ssl option.

Thanks,
Lior

rmmorrison added a commit to rmmorrison/logstash-output-mongodb that referenced this issue Aug 23, 2019
rmmorrison added a commit to rmmorrison/logstash-output-mongodb that referenced this issue Aug 23, 2019
@rmmorrison
Copy link
Contributor

I've opened pull request #66 with a fix for this issue.

nilskuhn added a commit to iteratec/logstash-output-mongodb that referenced this issue Sep 1, 2020
…lugins#65 and logstash-plugins#66

Makes plugin work with mongodb driver, version 2.6 (again)
arichiardi pushed a commit to elasticpath/logstash-output-mongodb that referenced this issue Oct 13, 2020
jsvd pushed a commit that referenced this issue Jan 31, 2022
…fixes #60, #64, #65) (#66)

Add missing second argument to to_bson methods, introduced with underlying Mongo driver update (fixes issues #60, #64, #65)
@bhumikadave
Copy link

bhumikadave commented Jun 9, 2022

Hey @jsvd @rmmorrison . Can you please elaborate what exactly is "with underlying Mongo driver update". Do I need to update anything with my mongo driver if I want to use 3.1.7? I'm still getting wrong number of arguments error with 3.1.7 after installing it with bin/logstash-plugin install .

Added #80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants