phutchins / logstash-input-mongodb

MongoDB input plugin for Logstash
Other
187 stars 104 forks source link

Not enough information about the plugin exceptions #87

Open sarra-bouhenni opened 6 years ago

sarra-bouhenni commented 6 years ago

I am using logstash-input-mongodb plugin to replicate a mongodb database.
Here is my config file (tested on different versions of Logstash 5.5.3/5.6.3/6.0.0):

input {
  mongodb {
    uri => "${MONGO_URI}"
    placeholder_db_dir => "${PLACEHOLDER_DB_DIR}"
    placeholder_db_name => "${PLACEHOLDER_DB_NAME}"
    collection => "${COLLECTION}"
    batch_size => "${BATCH_SIZE}"
  }
}
filter {
  mutate {
    remove_field => [ "_id" ]
  }
}
output {
  elasticsearch {
    hosts => "${ELASTICSEARCH_URI}"
    index => "${ELASTICSEARCH_INDEX}"
  }
}

After starting Logstash, I get the following exeption on every document treated by the plugin:

[2017-12-22T22:04:06,153][WARN ][logstash.inputs.mongodb  ] MongoDB Input threw an exception, restarting {:exception=>#<ArgumentError: comparison of String with 0 failed>}

I don't undestand its meaning, so I'm not sure what's wrong with my configuration or deployment. here is an example of the documents in the used collection :

{ "_id" : ObjectId("58c66181ca6ac600264cb94c"), "phone" : "+111111111111", "pin" : "0000", "is_verified" : true, "__v" : 0 }

Any further explanation about this kind of execeptions would be really appreciated.