# Filter http - delete by query doesn't work

**URL:** <https://discuss.elastic.co/t/filter-http-delete-by-query-doesnt-work/314371>\
**Category:** Logstash\
**Created:** [September 14, 2022, 6:18am UTC](https://discuss.elastic.co/t/filter-http-delete-by-query-doesnt-work/314371 "2022-09-14T06:18:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ely\_96](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ely_96/32/103816_2.png) [@Ely\_96](https://discuss.elastic.co/u/Ely_96)\
**Post date:** [September 14, 2022, 6:18am UTC](https://discuss.elastic.co/t/filter-http-delete-by-query-doesnt-work/314371/1 "2022-09-14T06:18:22Z")

</div>

Hi guys,  
in my pipeline, filter section I use the http plugin in order to remove old data:

```auto
http {
							url => "http://localhost:9200/test-main/_delete_by_query"
							verb => "POST"
							body_format => "json"
							body => '{"query":{"bool":{"filter":[{"term":{"code":"%{[code]}"}},{"term":{"id":"%{[id]}"}},{"range":{"req-timestamp":{"lt":%{[req-timestamp]}}}}]}}}'
						}

```

But I noticed that the query fails because the documents that match the query are still present.  
I tried running the same query (substituting parameters by hand) in dev tool and it works fine. If instead I make a POST request with postman, I get code 200 OK, but the documents are not removed.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/1/016c48c1e2e73636291683a659092dc90bedb672.png)

What am I doing wrong?

Thanks in advance  
Ely

---

<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:** [October 12, 2022, 6:18am UTC](https://discuss.elastic.co/t/filter-http-delete-by-query-doesnt-work/314371/2 "2022-10-12T06:18:25Z")

</div>

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