# Adding Kubernetes node name to output

**URL:** <https://discuss.elastic.co/t/adding-kubernetes-node-name-to-output/187536>\
**Category:** Beats\
**Tags:** heartbeat\
**Created:** [June 26, 2019, 9:55am UTC](https://discuss.elastic.co/t/adding-kubernetes-node-name-to-output/187536 "2019-06-26T09:55:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fredsted](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fredsted/32/6656_2.png) [@fredsted](https://discuss.elastic.co/u/fredsted)\
**Post date:** [June 26, 2019, 9:55am UTC](https://discuss.elastic.co/t/adding-kubernetes-node-name-to-output/187536/1 "2019-06-26T09:55:49Z")

</div>

Hi,

I've installed Heartbeat on my Kubernetes cluster (using Elasticsearch as output) on via the Helm chart.

I can't seem to figure out how to add the Kubernetes node name to the output since I want to see how the network performs on each node.

I've read the documentation at [https://www.elastic.co/guide/en/beats/heartbeat/current/add-kubernetes-metadata.html](https://www.elastic.co/guide/en/beats/heartbeat/current/add-kubernetes-metadata.html) without getting anywhere.

Here's what I've done so far:

```auto
  - add_kubernetes_metadata:
      in_cluster: true
      default_indexers.enabled: true
      default_matchers.enabled: true
      indexers:
      - container: null
      - pod_name: null
      - pod_uid: null
      - ip_port: null
      matchers:
      - fields: null
        lookup_fields:
        - container.id

```

Result: produces no kubernetes.\* fields in output. With that configuration, the fields I get in ES are beat.hostname (the pod name), beat.name, beat.version, host.name (the pod name), and the icmp.\* and monitor.\* fields that are working fine, not no Kubernetes output.

What am I missing? What's the magic combination of "indexers" and "matchers" (what are they, and where is there a list of them anyway?)

I've also tried adding the process environment (as the NODE\_NAME environment variable contains the Kubernetes node name), but that doesn't work either:

```auto
  - add_process_metadata:
      match_pids: [system.process.ppid]
      include_fields:
      - process.env
      restricted_fields: true

```

Docker metadata seems to work fine, however, but it doesn't contain the information I need.

For reference, here's the values file for the helm deployment: [https://gist.github.com/fredsted/5f736a6821061d24db4afd83a186f7a6](https://gist.github.com/fredsted/5f736a6821061d24db4afd83a186f7a6)

---

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)\
**Post date:** [June 28, 2019, 11:31am UTC](https://discuss.elastic.co/t/adding-kubernetes-node-name-to-output/187536/2 "2019-06-28T11:31:56Z")

</div>

Is your intention to add the metadata of the machine heartbeat is on, or the machines it is pinging? Usually it is the latter, which is accomplished by configuring via the autodiscovery providers [https://www.elastic.co/guide/en/beats/heartbeat/current/configuration-autodiscover.html#\_kubernetes](https://www.elastic.co/guide/en/beats/heartbeat/current/configuration-autodiscover.html#_kubernetes)

---

<div class="post-metadata">

**Author:** ![fredsted](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fredsted/32/6656_2.png) [@fredsted](https://discuss.elastic.co/u/fredsted)\
**Post date:** [June 28, 2019, 11:44am UTC](https://discuss.elastic.co/t/adding-kubernetes-node-name-to-output/187536/3 "2019-06-28T11:44:17Z")

</div>

For this, I need the metadata of the machine heartbeat is on – we're currently measuring the network performance of the Kubernetes nodes, and we'd like to know which ones are slower than others.

Does heartbeat not support that?

---

<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:** [July 26, 2019, 11:44am UTC](https://discuss.elastic.co/t/adding-kubernetes-node-name-to-output/187536/4 "2019-07-26T11:44:18Z")

</div>

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