# How to show data from multiple K8s clusters on Kibana Kubernetes dashboard (using metricbeat deployed on each cluster)?

**URL:** <https://discuss.elastic.co/t/how-to-show-data-from-multiple-k8s-clusters-on-kibana-kubernetes-dashboard-using-metricbeat-deployed-on-each-cluster/355919>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [March 21, 2024, 3:37pm UTC](https://discuss.elastic.co/t/how-to-show-data-from-multiple-k8s-clusters-on-kibana-kubernetes-dashboard-using-metricbeat-deployed-on-each-cluster/355919 "2024-03-21T15:37:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ioannisgk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ioannisgk/32/132875_2.png) [@ioannisgk](https://discuss.elastic.co/u/ioannisgk)\
**Post date:** [March 21, 2024, 3:37pm UTC](https://discuss.elastic.co/t/how-to-show-data-from-multiple-k8s-clusters-on-kibana-kubernetes-dashboard-using-metricbeat-deployed-on-each-cluster/355919/1 "2024-03-21T15:37:46Z")

</div>

Hello, I have 2 K8s clusters, Cluster A and Cluster B. I deployed Metricbeat on each cluster by using this yaml file: [beats/deploy/kubernetes/metricbeat-kubernetes.yaml at v8.12.2 · elastic/beats · GitHub](https://github.com/elastic/beats/blob/v8.12.2/deploy/kubernetes/metricbeat-kubernetes.yaml)

For metricbeat.yml file, I added the following extra configuration:

```auto
processors:
      - add_tags:
          tags: [cluster-dev]
      - add_cloud_metadata:
    output.elasticsearch:
      index: "cluster-dev-metrics-%{[agent.version]}"
      hosts: ['${ELASTICSEARCH_HOST:elasticsearch}:${ELASTICSEARCH_PORT:9200}']
      username: ${ELASTICSEARCH_USERNAME}
      password: ${ELASTICSEARCH_PASSWORD}
    setup:
      kibana.host: "https://kibana.example.com:443"
      dashboards.index: "cluster-dev-metrics-*"
      dashboards.enabled: true
      template.name: "cluster-dev-metrics-%{[agent.version]}"
      template.pattern: "cluster-dev-metrics-%{[agent.version]}"

```

This was done on each cluster, and can I see the kube-state-metrics and metricbeat pods as healthy. On Kibana, I see the 2 data views that are created, then I go to Discover and I see the metrics from Cluster A and the metrics from Cluster B. Since I added a different tag on each metricbeat.yml file, I can confirm that metrics from Cluster A have the correct tag, the same is true for Cluster B.

At this point, I have the metrics from the 2 clusters, that go to the Elasticsearch instance and I see them in Kibana Discover tab.

Now if I go to Kibana Dashboards and click on the newly created "[Metricbeat Kubernetes] Overview" dashboard, I see the data only from the cluster, on which I deployed metribeat **most recently**. And this is my problem. If I deploy metricbeat on Cluster A, I see that data from Cluster A in the dashboard. If I then deploy metricbeat on Cluster B, I only see data from Cluster B in the dashboard. I am not able to see data from **both** clusters in the Kibana Kubernetes dashboard.

This appears to be an intended functionality, because on this doc page [Configure Kibana dashboard loading | Metricbeat Reference [8.12] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-dashboards.html#_configuration_options_11) it says:

> When dashboard loading is enabled, Metricbeat overwrites any existing dashboards that match the names of the dashboards you are loading. This happens every time Metricbeat starts.

And since I have `dashboards.enabled: true` on both metricbeat.yml files, the latest deployment of metricbeat, overwrites the previous dashboards in Kibana.

What I want, is to configure the 2 instances of metricbeat, so that data from both Cluster A and Cluster B can be displayed in the "[Metricbeat Kubernetes] Overview" dashboard. I know that this should be possible, since this dashboard allows the user to select a cluster from a dropdown box list as you can see in this picture:

![Screenshot 2024-03-21 172623](https://us1.discourse-cdn.com/elastic/original/3X/1/0/10901081c1e055b9de9c10755a3795b8e07e234b.png)

Do you have any suggestions on how to get the data from both clusters and be able to display them in the "[Metricbeat Kubernetes] Overview" dashboard, by choosing the corresponding cluster by its Cluster Name?

On this page [Metricbeat setup overwrite Elastic Agent built in UI (Dashboard and Visualization)](https://discuss.elastic.co/t/metricbeat-setup-overwrite-elastic-agent-built-in-ui-dashboard-and-visualization/254235) someone mentioned:

> As a workaround you can try to setup the agent again and modifying the Metricbeat dashboard id of the dashboard that is being overridden. The dashboard file info is in kibana/7/dashboard folder of Metricbeat.

Would it be possible to configure the metricbeat.yml file, so that the dashboard IDs are different? That may be a valid workaround because I could have 2 links for 2 dashboards in Kibana, each one getting data from the corresponding cluster.

Thank you.

---

<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:** [April 18, 2024, 5:38pm UTC](https://discuss.elastic.co/t/how-to-show-data-from-multiple-k8s-clusters-on-kibana-kubernetes-dashboard-using-metricbeat-deployed-on-each-cluster/355919/2 "2024-04-18T17:38:42Z")

</div>

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