# Logstash delete all documents before http\_poller

**URL:** <https://discuss.elastic.co/t/logstash-delete-all-documents-before-http-poller/368470>\
**Category:** Logstash\
**Created:** [October 8, 2024, 3:54pm UTC](https://discuss.elastic.co/t/logstash-delete-all-documents-before-http-poller/368470 "2024-10-08T15:54:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dogee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dogee/32/138890_2.png) [@dogee](https://discuss.elastic.co/u/dogee)\
**Post date:** [October 8, 2024, 3:54pm UTC](https://discuss.elastic.co/t/logstash-delete-all-documents-before-http-poller/368470/1 "2024-10-08T15:54:12Z")

</div>

Hi,

How can I remove old data of an index before http\_polling ?

I call Jira API every day with http\_poller. Every call fetches data from Jira and creates documents. My problem is that I have finally too many duplicated documents in my index.

What is the best way to remove all documents from the index, before calling http\_poller ?

---

<div class="post-metadata">

**Author:** ![ashishtiwari1993](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashishtiwari1993/32/135241_2.png) [@ashishtiwari1993](https://discuss.elastic.co/u/ashishtiwari1993)\
**Post date:** [October 10, 2024, 8:07am UTC](https://discuss.elastic.co/t/logstash-delete-all-documents-before-http-poller/368470/2 "2024-10-10T08:07:01Z")

</div>

Hi Dogee, Welcome to the Elastic community.

Could you please share your pipeline configuration ? Also are you certain you getting unique data on every http polling call ?

---

<div class="post-metadata">

**Author:** ![dogee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dogee/32/138890_2.png) [@dogee](https://discuss.elastic.co/u/dogee)\
**Post date:** [October 30, 2024, 11:46pm UTC](https://discuss.elastic.co/t/logstash-delete-all-documents-before-http-poller/368470/3 "2024-10-30T23:46:23Z")

</div>

Hi,  
I finally find a solution to my problem, by using the field issue\_key as @documentId. Each document is then updated rather than duplicated after subsequent calls.  
Thanks.
