# Multi-cluster Kubernetes monitoring - best practices? Cluster name field?

**URL:** <https://discuss.elastic.co/t/multi-cluster-kubernetes-monitoring-best-practices-cluster-name-field/143990>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [August 11, 2018, 5:58pm UTC](https://discuss.elastic.co/t/multi-cluster-kubernetes-monitoring-best-practices-cluster-name-field/143990 "2018-08-11T17:58:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yoav\_Zuri](https://avatars.discourse-cdn.com/v4/letter/y/ed8c4c/32.png) [@Yoav\_Zuri](https://discuss.elastic.co/u/Yoav_Zuri)\
**Post date:** [August 11, 2018, 5:58pm UTC](https://discuss.elastic.co/t/multi-cluster-kubernetes-monitoring-best-practices-cluster-name-field/143990/1 "2018-08-11T17:58:00Z")

</div>

Hi,

I want to monitor multiple Kubernetes Clusters to one ES cluster using Filebeats.

Are there any best practices on how to separate the monitored clusters?

Can I add custom field to Beats per cluster? So it'll send something like "cluster\_name" so I can filter by it?

Thanks!

---

<div class="post-metadata">

**Author:** ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)\
**Post date:** [August 13, 2018, 4:28pm UTC](https://discuss.elastic.co/t/multi-cluster-kubernetes-monitoring-best-practices-cluster-name-field/143990/2 "2018-08-13T16:28:16Z")

</div>

Excatly. You can add a custom field to your `filebeat.yml` of a cluster.

```auto
fields:
  cluster_name: my_cluster

```

Or to collect the logs of a cluster in the same index in ES, you can set a unique index name:

```auto
index: "filebeat-%{[beat-version]}-my-cluster-id-%{[+yyyy.MM.dd]}"
setup.template.name: "filebeat-%{[beat-version]}-my-cluster-id"
setup.template.pattern: "filebeat-%{[beat-version]}-my-cluster-id-*"

```

---

<div class="post-metadata">

**Author:** ![Yoav\_Zuri](https://avatars.discourse-cdn.com/v4/letter/y/ed8c4c/32.png) [@Yoav\_Zuri](https://discuss.elastic.co/u/Yoav_Zuri)\
**Post date:** [August 14, 2018, 4:37pm UTC](https://discuss.elastic.co/t/multi-cluster-kubernetes-monitoring-best-practices-cluster-name-field/143990/3 "2018-08-14T16:37:31Z")

</div>

Followup question, now that I have all the cluster logs in the elasticsearch, separated with cluster\_name tag - how can I take specific logs coming from 3 specific kubernetes apps and parse them into separate indexes?

Currently I have both "system" logs for the VPN, Calico and all other logs combined with the application logs.

Thanks

---

<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 11, 2018, 4:37pm UTC](https://discuss.elastic.co/t/multi-cluster-kubernetes-monitoring-best-practices-cluster-name-field/143990/4 "2018-09-11T16:37:31Z")

</div>

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