# Deleting logs with common entry in it

**URL:** <https://discuss.elastic.co/t/deleting-logs-with-common-entry-in-it/91450>\
**Category:** Elasticsearch\
**Created:** [June 30, 2017, 2:19pm UTC](https://discuss.elastic.co/t/deleting-logs-with-common-entry-in-it/91450 "2017-06-30T14:19:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajat\_Singh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajat_singh/32/48128_2.png) [@Rajat\_Singh](https://discuss.elastic.co/u/Rajat_Singh)\
**Post date:** [June 30, 2017, 2:19pm UTC](https://discuss.elastic.co/t/deleting-logs-with-common-entry-in-it/91450/1 "2017-06-30T14:19:36Z")

</div>

I want to delete the logs from elastic search which is having "tags.raw=alkd3".

here tags is a field which will help in differentiating different webserver .

name of the index is access logs

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 30, 2017, 3:17pm UTC](https://discuss.elastic.co/t/deleting-logs-with-common-entry-in-it/91450/2 "2017-06-30T15:17:26Z")

</div>

I hope you are not going to DELETE too many documents. Otherwise, reindexing might be better.

Anyway, Delete By Query is probably what you are looking for: [https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-delete-by-query.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-delete-by-query.html)

---

<div class="post-metadata">

**Author:** ![Rajat\_Singh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajat_singh/32/48128_2.png) [@Rajat\_Singh](https://discuss.elastic.co/u/Rajat_Singh)\
**Post date:** [July 2, 2017, 5:48pm UTC](https://discuss.elastic.co/t/deleting-logs-with-common-entry-in-it/91450/3 "2017-07-02T17:48:52Z")

</div>

I explored and found this code  
curl -XDELETE '[http://10.150.86.175:9200/index](http://10.150.86.175:9200/index) name/\_query' -d '

> {  
> "query": {  
> "filtered" : {  
> "query" : {  
> "term" : { "field name" : "value" }  
> }
> 
> ```
> }
> 
> ```
> 
> }  
> }'

it worked for me

---

<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:** [July 30, 2017, 5:48pm UTC](https://discuss.elastic.co/t/deleting-logs-with-common-entry-in-it/91450/4 "2017-07-30T17:48:52Z")

</div>

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