# Delete documents after sync

**URL:** <https://discuss.elastic.co/t/delete-documents-after-sync/214236>\
**Category:** Logstash\
**Created:** [January 8, 2020, 12:54pm UTC](https://discuss.elastic.co/t/delete-documents-after-sync/214236 "2020-01-08T12:54:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tushar\_chevulkar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tushar_chevulkar/32/46270_2.png) [@tushar\_chevulkar](https://discuss.elastic.co/u/tushar_chevulkar)\
**Post date:** [January 8, 2020, 12:54pm UTC](https://discuss.elastic.co/t/delete-documents-after-sync/214236/1 "2020-01-08T12:54:07Z")

</div>

I have a logstash config where I am putting data from one to another

```
input {
  elasticsearch {
    hosts => ["http://localhost:9200"]
    index => "node_2"
    docinfo => true
  }
}

output {
  elasticsearch {
    hosts => ["http://localhost:9200"]
    index => "node_1"
    document_type => "fields"
    doc_as_upsert => true
    manage_template => false
    document_id => "%{[@metadata][_id]}"
  }
  stdout {
    codec => "dots"
  }
}

filter {
 mutate {
  remove_field => ["@version","@timestamp"]
 }
}

```

The above query is working fine but I just need to delete the documents form node\_2 after the sync is done.

Is there a way to do it same configuration ?

---

<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:** [February 5, 2020, 12:54pm UTC](https://discuss.elastic.co/t/delete-documents-after-sync/214236/2 "2020-02-05T12:54:09Z")

</div>

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