# Configuring heartbeat for different environments

**URL:** https://discuss.elastic.co/t/configuring-heartbeat-for-different-environments/102980
**Category:** Beats
**Created:** [October 6, 2017, 9:16am UTC](https://discuss.elastic.co/t/configuring-heartbeat-for-different-environments/102980 "2017-10-06T09:16:28Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)
#### Post date: [October 6, 2017, 9:16am UTC](https://discuss.elastic.co/t/configuring-heartbeat-for-different-environments/102980/1 "2017-10-06T09:16:28Z")

</div>

Hello,  
I am using heartbeat to check of various services on the environments however I can see that the environments are configured after the heartbeat\_monitors. Is that any way I can add multiple environments each with it's own heartbeat monitors in one server/config file? I would expect something like this:

```
heartbeat_monitors:
  - type: tcp
    hosts: ...
   ..
fields:
  env: production

heartbeat_monitors:
  - type: tcp
    hosts: ...
   ..
fields:
  env: staging

```

...

Thanks inadvance for you help.

---

<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: [October 6, 2017, 10:57am UTC](https://discuss.elastic.co/t/configuring-heartbeat-for-different-environments/102980/2 "2017-10-06T10:57:55Z")

</div>

For doing this you will need the most recent [heartbeat released with elastic stack rc1](https://www.elastic.co/downloads/beats/heartbeat#preview-release). This release adds support to add fields, tags and even local processors to individual monitors. Note, the [event format](https://github.com/elastic/beats/pull/4091) was changed (for good) + including some enhancements in the HTTP event generation.

Using this release you can configure heartbeat like this:

```auto
heartbeat.monitors:
- type: tcp
  hosts: ...
  fields.env: production

- type: tcp
  hosts: ...
  fields.env: staging

```

---

<div class="post-metadata">

### Author: ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)
#### Post date: [October 6, 2017, 11:25am UTC](https://discuss.elastic.co/t/configuring-heartbeat-for-different-environments/102980/3 "2017-10-06T11:25:52Z")

</div>

> [@steffens](#):
>
> fields.env: production

OK my question is if I install this rc1 version of heartbeat can I later on when it will be released get back to the stable version and have it still working?

Regards,  
Peter

---

<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: [October 8, 2017, 10:35am UTC](https://discuss.elastic.co/t/configuring-heartbeat-for-different-environments/102980/4 "2017-10-08T10:35:58Z")

</div>

With rc1 out, only critical bug-fixes will be applied before GA. The feature-set of heartbeat is fixed until release.

Please note heartbeat in general is still in beta (even with upcoming elastic stack release). Check out the [Heartbeat to GA Roadmap](https://github.com/elastic/beats/issues/3952).

---

<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: [October 27, 2017, 9:17am UTC](https://discuss.elastic.co/t/configuring-heartbeat-for-different-environments/102980/5 "2017-10-27T09:17:12Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
