# Delete data from index based on log.file.path

**URL:** <https://discuss.elastic.co/t/delete-data-from-index-based-on-log-file-path/211158>\
**Category:** Elasticsearch\
**Created:** [December 9, 2019, 4:48pm UTC](https://discuss.elastic.co/t/delete-data-from-index-based-on-log-file-path/211158 "2019-12-09T16:48:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NogNeetMachinaal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nogneetmachinaal/32/58893_2.png) [@NogNeetMachinaal](https://discuss.elastic.co/u/NogNeetMachinaal)\
**Post date:** [December 9, 2019, 4:48pm UTC](https://discuss.elastic.co/t/delete-data-from-index-based-on-log-file-path/211158/1 "2019-12-09T16:48:46Z")

</div>

Team,  
Is there a way to delete all data that is read from a specific folder?  
For example, I would like to delete all data that was indexed from the logs in folder /home/will/logs. This folder name is found in the field log.file.path from the index filebeat-7.5.0-2019.12.07-000001.

Thanks - Will

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 10, 2019, 12:53pm UTC](https://discuss.elastic.co/t/delete-data-from-index-based-on-log-file-path/211158/2 "2019-12-10T12:53:21Z")

</div>

You may want to take a look at the [Delete by Query API](https://www.elastic.co/guide/en/elasticsearch/reference/7.5/docs-delete-by-query.html) and selecting documents that have your path set.

---

<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:** [January 7, 2020, 12:53pm UTC](https://discuss.elastic.co/t/delete-data-from-index-based-on-log-file-path/211158/3 "2020-01-07T12:53:24Z")

</div>

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