# Mongodb - MongoDB Input threw an exception, restarting {:exception=\>#\<BSON::ObjectId::Invalid: '003cd541-2dd3-4a8e-89b0-595c74a9e4f9' is an invalid ObjectID

**URL:** https://discuss.elastic.co/t/mongodb-mongodb-input-threw-an-exception-restarting-exception-bson-003cd541-2dd3-4a8e-89b0-595c74a9e4f9-is-an-invalid-objectid/268045
**Category:** Logstash
**Created:** [March 23, 2021, 6:11am UTC](https://discuss.elastic.co/t/mongodb-mongodb-input-threw-an-exception-restarting-exception-bson-003cd541-2dd3-4a8e-89b0-595c74a9e4f9-is-an-invalid-objectid/268045 "2021-03-23T06:11:21Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![deepakELKB](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@deepakELKB](https://discuss.elastic.co/u/deepakELKB)
#### Post date: [March 23, 2021, 6:11am UTC](https://discuss.elastic.co/t/mongodb-mongodb-input-threw-an-exception-restarting-exception-bson-003cd541-2dd3-4a8e-89b0-595c74a9e4f9-is-an-invalid-objectid/268045/1 "2021-03-23T06:11:21Z")

</div>

Hi I am getting this error during creation of index from mongodb input plugin.  
I have also integrate filter and remove \_id filed but still getting same error.

```auto

input {
mongodb{
        uri => "mongodb+srv://localhost:27017/mydb?ssl=false"
	        placeholder_db_dir => "/opt/logstash-mongodb/"
        placeholder_db_name => "logstash_sqlite2.db"
        collection => "transaction"
        batch_size => 5000
}
}

filter {
mutate {
copy => { "_id" => "[@metadata][_id]"}
remove_field => ["_id"]

}
}

output {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "transaction-logs-new-%{+dd.MM.YYYY}"
}

stdout {}
}

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [April 20, 2021, 6:11am UTC](https://discuss.elastic.co/t/mongodb-mongodb-input-threw-an-exception-restarting-exception-bson-003cd541-2dd3-4a8e-89b0-595c74a9e4f9-is-an-invalid-objectid/268045/2 "2021-04-20T06:11:52Z")

</div>

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