# Filebeat on Kubernetes - How to get relevant kuberntes information into logs?

**URL:** https://discuss.elastic.co/t/filebeat-on-kubernetes-how-to-get-relevant-kuberntes-information-into-logs/211019
**Category:** Beats
**Tags:** filebeat
**Created:** [December 8, 2019, 4:13pm UTC](https://discuss.elastic.co/t/filebeat-on-kubernetes-how-to-get-relevant-kuberntes-information-into-logs/211019 "2019-12-08T16:13:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Justin\_Seiser](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/justin_seiser/32/45092_2.png) [@Justin\_Seiser](https://discuss.elastic.co/u/Justin_Seiser)
#### Post date: [December 8, 2019, 4:13pm UTC](https://discuss.elastic.co/t/filebeat-on-kubernetes-how-to-get-relevant-kuberntes-information-into-logs/211019/1 "2019-12-08T16:13:33Z")

</div>

Im using filebeat, installed via helm, from the official helm chart. We are sending logs to ElasticCloud.

My filebeat.yaml

setup.dashboards.enabled: true  
logging.metrics:  
enabled: false  
filebeat.inputs:

- type: container  
paths:
  - /var/lib/docker/containers/_/_.log  
processors:
  - add\_kubernetes\_metadata:  
in\_cluster: true
  - add\_cloud\_metadata:
  - add\_host\_metadata:  
cloud.id: "xxx:xxx"  
cloud.auth: "elastic:xxxx"  
output.elasticsearch:  
hosts: "[https://xxx.us-east-1.aws.found.io:9243](https://xxx.us-east-1.aws.found.io:9243)"  
setup.kibana:  
host: "[https://xxx.us-east-1.aws.found.io:9243](https://xxx.us-east-1.aws.found.io:9243)"

Im getting logs, but im not getting things like.. the pod name, the namespace, any annotations or labels. So I cant really tell what log goes with what service.

Thanks,

---

<div class="post-metadata">

### Author: ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)
#### Post date: [December 9, 2019, 10:04am UTC](https://discuss.elastic.co/t/filebeat-on-kubernetes-how-to-get-relevant-kuberntes-information-into-logs/211019/2 "2019-12-09T10:04:33Z")

</div>

Hi @Justin_Seiser!

This can be achieved with [`add_kubernetes_metadata`](https://www.elastic.co/guide/en/beats/filebeat/master/add-kubernetes-metadata.html) processor.

It seems that the Helm chart is a little bit outdated and `in_cluster` config option should not be there. I will send a fix for that however you could edit it manually if you don't want to wait for the upstream change. ([patch](https://github.com/elastic/helm-charts/pull/403))

Meanwhile could you check in Filebeat's logs for stuff related to `add_kubernetes_metadata` so as to make sure that the processor is being initialized without errors?

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: [January 6, 2020, 10:04am UTC](https://discuss.elastic.co/t/filebeat-on-kubernetes-how-to-get-relevant-kuberntes-information-into-logs/211019/3 "2020-01-06T10:04:40Z")

</div>

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