# Removing data from Elasticsearch

**URL:** <https://discuss.elastic.co/t/removing-data-from-elasticsearch/95784>\
**Category:** Elasticsearch\
**Created:** [August 3, 2017, 11:01pm UTC](https://discuss.elastic.co/t/removing-data-from-elasticsearch/95784 "2017-08-03T23:01:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Puk](https://avatars.discourse-cdn.com/v4/letter/p/ea5d25/32.png) [@Puk](https://discuss.elastic.co/u/Puk)\
**Post date:** [August 3, 2017, 11:01pm UTC](https://discuss.elastic.co/t/removing-data-from-elasticsearch/95784/1 "2017-08-03T23:01:00Z")

</div>

Newbie to ELK Stack here and have just deployed it to my environment after testing it out in a lab for a few weeks. Its going great and I have all my servers reporting in after pushing filebeat with Ansible, but I'm finding some logs with lots of data I don't want in ELK.

I'm filtering this out after the fact in the filebeat.yml files, but I want to get rid of the data from Elasticsearch, as for example I found some of my hosts with over 1GB of /var/log/messages per day which I don't want.

So far all I've found is **curl '[http://10.10.10.1:9200/\_cat/indices?v](http://10.10.10.1:9200/_cat/indices?v)'** to search for the indexes and then **curl -XDELETE '[http://10.10.10.1:9200/filebeat-2017.08.03](http://10.10.10.1:9200/filebeat-2017.08.03)'** to remove them. THis works fine as the data at this moment isn't important so I can just flush on mass, but my questions are:-1:

1. Does this flush everything, or is there other stuff I need to clear out? I have a feeling I'm just removing the index and not raw data?
2. Is there a way to do this but just target one specific beats.hostname?

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [August 3, 2017, 11:46pm UTC](https://discuss.elastic.co/t/removing-data-from-elasticsearch/95784/2 "2017-08-03T23:46:05Z")

</div>

Deleting an index leads to the underlying data being deleted.

For your second question, you can use delete-by-query.

---

<div class="post-metadata">

**Author:** ![Puk](https://avatars.discourse-cdn.com/v4/letter/p/ea5d25/32.png) [@Puk](https://discuss.elastic.co/u/Puk)\
**Post date:** [August 4, 2017, 2:27am UTC](https://discuss.elastic.co/t/removing-data-from-elasticsearch/95784/3 "2017-08-04T02:27:50Z")

</div>

Thanks, thats good to know it deletes the data too.

---

<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:** [September 1, 2017, 2:27am UTC](https://discuss.elastic.co/t/removing-data-from-elasticsearch/95784/4 "2017-09-01T02:27:56Z")

</div>

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