# List of hosts to ping?

**URL:** https://discuss.elastic.co/t/list-of-hosts-to-ping/120437
**Category:** Beats
**Tags:** heartbeat
**Created:** [February 19, 2018, 11:23am UTC](https://discuss.elastic.co/t/list-of-hosts-to-ping/120437 "2018-02-19T11:23:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kottapar](https://avatars.discourse-cdn.com/v4/letter/k/a87d85/32.png) [@kottapar](https://discuss.elastic.co/u/kottapar)
#### Post date: [February 19, 2018, 11:23am UTC](https://discuss.elastic.co/t/list-of-hosts-to-ping/120437/1 "2018-02-19T11:23:32Z")

</div>

Hey guys, I was just wondering if it's possible to provide a list of hosts in the "hosts" field for the ping test.  
For example, in our case we want to do a ping test to all the servers in the list /tmp/unixhosts. The documentation says comma seperated values.

```
- type: tcp
  schedule: '@every 60s'
  hosts: ["/tmp/unixhosts"]
  ports: [22]
```

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [February 19, 2018, 3:49pm UTC](https://discuss.elastic.co/t/list-of-hosts-to-ping/120437/2 "2018-02-19T15:49:00Z")

</div>

The `hosts` field is a list (See [Config file format docs](https://www.elastic.co/guide/en/beats/libbeat/current/config-file-format.html#config-file-format)). You can either use `['url1', 'url2', ...]` or have one URL per line by writing:

```auto
- type: txp
  schedule: ...
  ports: ...
  hosts:
    - host1
    - host2
    - host3

```

As you have the list in an external file, you need to make use of config reloading using the [watch.poll\_file](https://www.elastic.co/guide/en/beats/heartbeat/current/configuration-heartbeat-options.html#monitor-watch-poll-file) setting. This one requires JSON, though.

---

<div class="post-metadata">

### Author: ![kottapar](https://avatars.discourse-cdn.com/v4/letter/k/a87d85/32.png) [@kottapar](https://discuss.elastic.co/u/kottapar)
#### Post date: [February 22, 2018, 10:26am UTC](https://discuss.elastic.co/t/list-of-hosts-to-ping/120437/3 "2018-02-22T10:26:07Z")

</div>

Thank you, although I was looking at something that'd just take a plain text file as an input 🙂

---

<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: [March 22, 2018, 10:26am UTC](https://discuss.elastic.co/t/list-of-hosts-to-ping/120437/4 "2018-03-22T10:26:14Z")

</div>

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