# How to fetch data from multiple hostnames in es

**URL:** https://discuss.elastic.co/t/how-to-fetch-data-from-multiple-hostnames-in-es/311414
**Category:** Elasticsearch
**Created:** [August 4, 2022, 11:43am UTC](https://discuss.elastic.co/t/how-to-fetch-data-from-multiple-hostnames-in-es/311414 "2022-08-04T11:43:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Gojo](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@Gojo](https://discuss.elastic.co/u/Gojo)
#### Post date: [August 4, 2022, 11:43am UTC](https://discuss.elastic.co/t/how-to-fetch-data-from-multiple-hostnames-in-es/311414/1 "2022-08-04T11:43:29Z")

</div>

hey all iam new to elk , iam trying to get all the hosts in the Elasticsearch db , i tried using a wildcard and

```auto
"wild_card": "hosts",
"query": {
"host.keyword": "test*",
"severity.keyword": "err"
},

```

consider there are multiple hosts like test1,test2,test3 i want to all them to be listed in a query , can someone help me with this

---

<div class="post-metadata">

### Author: ![79g](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/79g/32/109191_2.png) [@79g](https://discuss.elastic.co/u/79g)
#### Post date: [August 4, 2022, 1:26pm UTC](https://discuss.elastic.co/t/how-to-fetch-data-from-multiple-hostnames-in-es/311414/2 "2022-08-04T13:26:02Z")

</div>

Hello,

> [@Gojo](#):
>
> iam trying to get all the hosts in the Elasticsearch db

what do you mean with that? Do you want to list the nodes? If so:

```auto
GET _cat/nodes

```

Also: [Cluster APIs | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html) could help.

---

<div class="post-metadata">

### Author: ![Gojo](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@Gojo](https://discuss.elastic.co/u/Gojo)
#### Post date: [August 5, 2022, 6:16am UTC](https://discuss.elastic.co/t/how-to-fetch-data-from-multiple-hostnames-in-es/311414/3 "2022-08-05T06:16:41Z")

</div>

hi iam currently using scroll api to fetch logs form es , but it can only fetch for one hostname , but i want to fetch for multiple hostnames that iam giving any idea would help me

---

<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 2, 2022, 6:17am UTC](https://discuss.elastic.co/t/how-to-fetch-data-from-multiple-hostnames-in-es/311414/4 "2022-09-02T06:17:14Z")

</div>

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