# Is there a way to cat only yellow shards in haproxy.cfg?

**URL:** <https://discuss.elastic.co/t/is-there-a-way-to-cat-only-yellow-shards-in-haproxy-cfg/108916>\
**Category:** Elasticsearch\
**Created:** [November 23, 2017, 3:36pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-cat-only-yellow-shards-in-haproxy-cfg/108916 "2017-11-23T15:36:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogue](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@rogue](https://discuss.elastic.co/u/rogue)\
**Post date:** [November 23, 2017, 3:36pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-cat-only-yellow-shards-in-haproxy-cfg/108916/1 "2017-11-23T15:36:16Z")

</div>

Hello fellas!

I would like to have yellow shards for one of my backend configs. Right now I have this one:

backend blabla  
mode tcp  
balance roundrobin  
option httpchk get /\_cat/indices  
http-check expect rstring \b(green|yellow)\b  
server s1 someip1:9222 check port 9201 inter 12000 rise 2 fall 2  
server s2 someip2:9222 check port 9201 inter 12000 rise 2 fall 2  
server s3 someip3:9222 check port 9201 inter 12000 rise 2 fall 2

I want something like /indices/health=yellow (i know it's wrong this way) but I can't find anything like this through the dox. Any help is much appreciated!

---

<div class="post-metadata">

**Author:** ![luiz.santos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luiz.santos/32/24664_2.png) [@luiz.santos](https://discuss.elastic.co/u/luiz.santos)\
**Post date:** [December 1, 2017, 12:59pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-cat-only-yellow-shards-in-haproxy-cfg/108916/2 "2017-12-01T12:59:29Z")

</div>

Hi rogue,

You can specify which header of the \_cat API you want. For example, to show the health header:

[http://localhost:9200/\_cat/indices?h=health](http://localhost:9200/_cat/indices?h=health)

Does it work for you?

Cheers,  
LG

---

<div class="post-metadata">

**Author:** ![rogue](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@rogue](https://discuss.elastic.co/u/rogue)\
**Post date:** [December 7, 2017, 1:47pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-cat-only-yellow-shards-in-haproxy-cfg/108916/3 "2017-12-07T13:47:15Z")

</div>

Yes, perfect!

---

<div class="post-metadata">

**Author:** ![rogue](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@rogue](https://discuss.elastic.co/u/rogue)\
**Post date:** [December 7, 2017, 1:50pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-cat-only-yellow-shards-in-haproxy-cfg/108916/4 "2017-12-07T13:50:57Z")

</div>

Actually, can i do the same for /\_cluster/health but instead of the whole json I would like to receive whether it is green or yellow? I can't use stuff like cut or awk ..

---

<div class="post-metadata">

**Author:** ![luiz.santos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luiz.santos/32/24664_2.png) [@luiz.santos](https://discuss.elastic.co/u/luiz.santos)\
**Post date:** [December 7, 2017, 5:32pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-cat-only-yellow-shards-in-haproxy-cfg/108916/5 "2017-12-07T17:32:56Z")

</div>

Hi Rogue,

In the last example [http://localhost:9200/\_cat/indices?h=health](http://localhost:9200/_cat/indices?h=health) the result is the indices health.

Now you are asking for cluster health, which you be [http://localhost:9200/\_cat/health?h=status](http://localhost:9200/_cat/health?h=status).

Best,  
LG

---

<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 4, 2018, 5:33pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-cat-only-yellow-shards-in-haproxy-cfg/108916/6 "2018-01-04T17:33:05Z")

</div>

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