# Cleaning up red Shards

**URL:** <https://discuss.elastic.co/t/cleaning-up-red-shards/19660>\
**Category:** Elasticsearch\
**Created:** [September 8, 2014, 1:34pm UTC](https://discuss.elastic.co/t/cleaning-up-red-shards/19660 "2014-09-08T13:34:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johnathan\_Phan\_3](https://avatars.discourse-cdn.com/v4/letter/j/da6949/32.png) [@Johnathan\_Phan\_3](https://discuss.elastic.co/u/Johnathan_Phan_3)\
**Post date:** [September 8, 2014, 1:34pm UTC](https://discuss.elastic.co/t/cleaning-up-red-shards/19660/1 "2014-09-08T13:34:38Z")

</div>

Hi everyone,

say you have 100-200 index's where one of the shards, replica and primary  
have gotten corrupted. Lets just say they are completely bonked.

Someone must have a simply query to identify which index's these are and  
how to mass delete them all since they have entered an unrecoverable state.

Regards

John

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/af6f5731-ccbc-4cf9-adcf-673e65849825%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/af6f5731-ccbc-4cf9-adcf-673e65849825%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 8, 2014, 8:57pm UTC](https://discuss.elastic.co/t/cleaning-up-red-shards/19660/2 "2014-09-08T20:57:28Z")

</div>

Check out the cat APIs for, there are end points for indexes and shards  
that will give you this info.

Regards,  
Mark Walkom

Infrastructure Engineer  
Campaign Monitor  
email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
web: [www.campaignmonitor.com](http://www.campaignmonitor.com)

On 8 September 2014 23:34, Johnathan Phan [jphan@berryjar.com](mailto:jphan@berryjar.com) wrote:

> Hi everyone,
> 
> say you have 100-200 index's where one of the shards, replica and primary  
> have gotten corrupted. Lets just say they are completely bonked.
> 
> Someone must have a simply query to identify which index's these are and  
> how to mass delete them all since they have entered an unrecoverable state.
> 
> Regards
> 
> John
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/af6f5731-ccbc-4cf9-adcf-673e65849825%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/af6f5731-ccbc-4cf9-adcf-673e65849825%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/af6f5731-ccbc-4cf9-adcf-673e65849825%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/af6f5731-ccbc-4cf9-adcf-673e65849825%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEM624Z3sK8VtA4i3xq6y5bXz%3Dz1LrGhRgri3tHaRsM%3DcPiC3A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624Z3sK8VtA4i3xq6y5bXz%3Dz1LrGhRgri3tHaRsM%3DcPiC3A%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Johnathan\_Phan\_2](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@Johnathan\_Phan\_2](https://discuss.elastic.co/u/Johnathan_Phan_2)\
**Post date:** [September 9, 2014, 9:57am UTC](https://discuss.elastic.co/t/cleaning-up-red-shards/19660/3 "2014-09-09T09:57:54Z")

</div>

Hey mate, sorry solved this in the irc channel.

For future reference I created the following command to delete all red  
index's.

curl -s localhost:9200/\_cat/indices 2\>&1 | grep ^red | awk '{print $2}' |  
while read red; do curl -XDELETE '[http://localhost:9200/$red](http://localhost:9200/$red)'; done

Regards

John

On Mon, Sep 8, 2014 at 9:57 PM, Mark Walkom [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
wrote:

> Check out the cat APIs for, there are end points for indexes and shards  
> that will give you this info.
> 
> Regards,  
> Mark Walkom
> 
> Infrastructure Engineer  
> Campaign Monitor  
> email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
> web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> 
> On 8 September 2014 23:34, Johnathan Phan [jphan@berryjar.com](mailto:jphan@berryjar.com) wrote:
> 
> > Hi everyone,
> > 
> > say you have 100-200 index's where one of the shards, replica and primary  
> > have gotten corrupted. Lets just say they are completely bonked.
> > 
> > Someone must have a simply query to identify which index's these are and  
> > how to mass delete them all since they have entered an unrecoverable state.
> > 
> > Regards
> > 
> > John
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/af6f5731-ccbc-4cf9-adcf-673e65849825%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/af6f5731-ccbc-4cf9-adcf-673e65849825%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/af6f5731-ccbc-4cf9-adcf-673e65849825%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/af6f5731-ccbc-4cf9-adcf-673e65849825%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/PJt6iA5AAcc/unsubscribe](https://groups.google.com/d/topic/elasticsearch/PJt6iA5AAcc/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAEM624Z3sK8VtA4i3xq6y5bXz%3Dz1LrGhRgri3tHaRsM%3DcPiC3A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624Z3sK8VtA4i3xq6y5bXz%3Dz1LrGhRgri3tHaRsM%3DcPiC3A%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAEM624Z3sK8VtA4i3xq6y5bXz%3Dz1LrGhRgri3tHaRsM%3DcPiC3A%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAEM624Z3sK8VtA4i3xq6y5bXz%3Dz1LrGhRgri3tHaRsM%3DcPiC3A%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPfM1kBMBnEPU%3DdpR7ADR1%3DX%3DtbYuKJkgwLiAfbLu1xK0k6mdg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPfM1kBMBnEPU%3DdpR7ADR1%3DX%3DtbYuKJkgwLiAfbLu1xK0k6mdg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:03am UTC](https://discuss.elastic.co/t/cleaning-up-red-shards/19660/4 "2017-07-06T01:03:46Z")

</div>


