# Logstash-input-mongodb update and delete doc

**URL:** <https://discuss.elastic.co/t/logstash-input-mongodb-update-and-delete-doc/143360>\
**Category:** Logstash\
**Created:** [August 7, 2018, 3:23pm UTC](https://discuss.elastic.co/t/logstash-input-mongodb-update-and-delete-doc/143360 "2018-08-07T15:23:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![abilio-cs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abilio-cs/32/34272_2.png) [@abilio-cs](https://discuss.elastic.co/u/abilio-cs)\
**Post date:** [August 7, 2018, 3:23pm UTC](https://discuss.elastic.co/t/logstash-input-mongodb-update-and-delete-doc/143360/1 "2018-08-07T15:23:15Z")

</div>

Hello!

I am using logstash in order to replace mongo-connector, so I need to update and delete docs that were changed in MongoDB.

I set upsert and I also tried to set the action, however it seems that the input is not detected, here is my conf:

```
input {
 mongodb {
  uri => 'mongodb://localhost:27017/CitrusDB'
  placeholder_db_dir => '/elk/logstash-mongodb/'
  placeholder_db_name => 'test.db'
  collection => 'Numbers'
  batch_size => 5000
 }
}

filter{
 mutate{
  remove_field => ["mongo_id","@timestamp","_id","host","@version","logdate","log_entry"]
 }
}

output {
 elasticsearch { 
  hosts => ["localhost:9200"] 
  doc_as_upsert => true
  index => "citrusdb"
  document_type => "numbers"
 }
 stdout { codec => rubydebug }
}

```

Logstash 6.3.2  
Elastic 6.3.1

Any thoughts?

---

<div class="post-metadata">

**Author:** ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)\
**Post date:** [August 8, 2018, 12:22am UTC](https://discuss.elastic.co/t/logstash-input-mongodb-update-and-delete-doc/143360/2 "2018-08-08T00:22:12Z")

</div>

The [MongoDB Input Plugin](https://github.com/phutchins/logstash-input-mongodb/issues) that you're using is a community-provided plugin that currently appears to be abandonware; it has many open issues, and hasn't seen any changes in more than a year 😩

---

<div class="post-metadata">

**Author:** ![abilio-cs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abilio-cs/32/34272_2.png) [@abilio-cs](https://discuss.elastic.co/u/abilio-cs)\
**Post date:** [August 8, 2018, 1:47pm UTC](https://discuss.elastic.co/t/logstash-input-mongodb-update-and-delete-doc/143360/3 "2018-08-08T13:47:45Z")

</div>

Is there an option? What would be the best way to use MongoDB, Logstash and Elastic?

---

<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:** [September 5, 2018, 1:47pm UTC](https://discuss.elastic.co/t/logstash-input-mongodb-update-and-delete-doc/143360/4 "2018-09-05T13:47:48Z")

</div>

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