Sync data from MongoDB using logstash

I'm using Logstash 6.8.0 to push my Message collection to Elasticsearch 6.8.0. This is my logstash file:

input {
  jdbc {
    jdbc_connection_string => "jdbc:mongodb://127.0.0.1:27017/vnpost_chatdb"
    jdbc_driver_library => "C:/Users/victo/mongojdbc3.1.jar"
    jdbc_driver_class => "com.dbschema.MongoJdbcDriver"
    jdbc_user => "" 
    jdbc_password => ""
    schedule => "*/5 * * * * *"
    statement => "db.Message.find({},{'_id': false, 'createdAt': false})"
  }
}
output {
  elasticsearch {
    "hosts" => ["127.0.0.1:9200"]
    "index" => "message_mng"
    "document_type" => "message"
    "document_id" => "%{id}"
  }
}

After running the config file, I was able to create a index but there is no data available there. I also notice an error:
java.nio.file.NoSuchFileException: C:\Users\victo\.DbSchema\logs\MongoDbJdbcDriver.log.lck

Can anyone help me with this? Thanks in advance!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.