# Query index in Elasticsearch cluster

**URL:** https://discuss.elastic.co/t/query-index-in-elasticsearch-cluster/215603
**Category:** Elasticsearch
**Created:** [January 19, 2020, 6:38am UTC](https://discuss.elastic.co/t/query-index-in-elasticsearch-cluster/215603 "2020-01-19T06:38:21Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![bdn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bdn/32/136737_2.png) [@bdn](https://discuss.elastic.co/u/bdn)
#### Post date: [January 19, 2020, 6:38am UTC](https://discuss.elastic.co/t/query-index-in-elasticsearch-cluster/215603/1 "2020-01-19T06:38:21Z")

</div>

I've configured an Elasticsearch Cluster of 3 nodes. Now I'm planning to write a bash script which will query for the index from the curl command without mentioning the ES node name as this cluster setup allows up to 1 node failover. If I mention a specific node name then I may not get the output as that node might be down. Is there any proper way to call the script and get data from outside the ES network?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [January 19, 2020, 6:41am UTC](https://discuss.elastic.co/t/query-index-in-elasticsearch-cluster/215603/2 "2020-01-19T06:41:29Z")

</div>

I would use a scripting language for which there exists an official client, e.g. Python, rather than bash as the clients handle failover. If you are using bash you will need to build this yourself.

---

<div class="post-metadata">

### Author: ![bdn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bdn/32/136737_2.png) [@bdn](https://discuss.elastic.co/u/bdn)
#### Post date: [January 19, 2020, 9:50am UTC](https://discuss.elastic.co/t/query-index-in-elasticsearch-cluster/215603/3 "2020-01-19T09:50:20Z")

</div>

Thank you for the suggestion. Now I'm using ES Client GO API.

---

<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: [February 16, 2020, 9:52am UTC](https://discuss.elastic.co/t/query-index-in-elasticsearch-cluster/215603/4 "2020-02-16T09:52:40Z")

</div>

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