# How to get hostname of "Elastic" server / "Cluster" name where the watcher is running?

**URL:** <https://discuss.elastic.co/t/how-to-get-hostname-of-elastic-server-cluster-name-where-the-watcher-is-running/247552>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [September 4, 2020, 2:00pm UTC](https://discuss.elastic.co/t/how-to-get-hostname-of-elastic-server-cluster-name-where-the-watcher-is-running/247552 "2020-09-04T14:00:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kelk](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@kelk](https://discuss.elastic.co/u/kelk)\
**Post date:** [September 4, 2020, 2:00pm UTC](https://discuss.elastic.co/t/how-to-get-hostname-of-elastic-server-cluster-name-where-the-watcher-is-running/247552/1 "2020-09-04T14:00:14Z")

</div>

hi  
we have a clustered environment. Is there a way to get where the "watcher" have run? We have putting a same set of watcher ,but needed to ensure only PROD watchers are alerted. Hence wanted to filter on a specific key-word of the "elastic\_host" in our logic.

In Splunk , there are default fields like "splunk\_server" which comes up with every event. Is there any such fields which may be hidden somewhere for elastic where I can make use upon?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [September 16, 2020, 10:17am UTC](https://discuss.elastic.co/t/how-to-get-hostname-of-elastic-server-cluster-name-where-the-watcher-is-running/247552/2 "2020-09-16T10:17:48Z")

</div>

There is no metadata variable for the cluster name. You could use the `metadata` field in the watch to mark a watch on each cluster as prod or dev.

---

<div class="post-metadata">

**Author:** ![kelk](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@kelk](https://discuss.elastic.co/u/kelk)\
**Post date:** [September 16, 2020, 3:16pm UTC](https://discuss.elastic.co/t/how-to-get-hostname-of-elastic-server-cluster-name-where-the-watcher-is-running/247552/3 "2020-09-16T15:16:04Z")

</div>

oh.ok. quite hard for us as there are dozens of systems and ahve to manually add the metadata. anyway, nice to have the ctx to contain cluster-name/servername

---

<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 14, 2020, 3:16pm UTC](https://discuss.elastic.co/t/how-to-get-hostname-of-elastic-server-cluster-name-where-the-watcher-is-running/247552/4 "2020-10-14T15:16:24Z")

</div>

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