# Filebeat processor add\_kubernetes\_metadata is not working with input type log

**URL:** https://discuss.elastic.co/t/filebeat-processor-add-kubernetes-metadata-is-not-working-with-input-type-log/199588
**Category:** Beats
**Tags:** docker, filebeat
**Created:** [September 16, 2019, 7:10am UTC](https://discuss.elastic.co/t/filebeat-processor-add-kubernetes-metadata-is-not-working-with-input-type-log/199588 "2019-09-16T07:10:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Himanshu\_Rajput](https://avatars.discourse-cdn.com/v4/letter/h/f05b48/32.png) [@Himanshu\_Rajput](https://discuss.elastic.co/u/Himanshu_Rajput)
#### Post date: [September 16, 2019, 7:10am UTC](https://discuss.elastic.co/t/filebeat-processor-add-kubernetes-metadata-is-not-working-with-input-type-log/199588/1 "2019-09-16T07:10:26Z")

</div>

We are using filebeat v 7.3 over Kubernetes. Along with pod's logs, we also want to push host logs to elasticsearch. We have mounted "/var/log/messages" of host towards the filebeat pod. The logs are successfully being pushed to elasticsearch but kubernetes metadata is not being added to logs.  
Here is my fileabeat input configuration-

> ```
> - type: docker
> containers.ids:
> - "*"
> multiline.pattern: '^DEBUG'
> multiline.negate: true
> multiline.match: 'after'
> processors:
> - add_kubernetes_metadata:
> in_cluster: true
> - type: log
> paths:
> - /var/log/host/messages
> processors:
> - add_kubernetes_metadata:
> in_cluster: true
> 
> ```

For the first input type **docker** , we are getting the Kubernetes metadata but for the second type **log** , we are not getting any metadata.

---

<div class="post-metadata">

### Author: ![pmercado](https://avatars.discourse-cdn.com/v4/letter/p/59ef9b/32.png) [@pmercado](https://discuss.elastic.co/u/pmercado)
#### Post date: [September 16, 2019, 1:11pm UTC](https://discuss.elastic.co/t/filebeat-processor-add-kubernetes-metadata-is-not-working-with-input-type-log/199588/2 "2019-09-16T13:11:52Z")

</div>

Hi @Himanshu_Rajput,

I'm not sure which metadata would be expected for the second block. If you are expecting host metadata, I would suggest `add_host_metadata`

I think filebeat looks for the pod/container information based on log path, which makes /var/log/host/messages not suitable for adding kubernetes metadata.

---

<div class="post-metadata">

### Author: ![Himanshu\_Rajput](https://avatars.discourse-cdn.com/v4/letter/h/f05b48/32.png) [@Himanshu\_Rajput](https://discuss.elastic.co/u/Himanshu_Rajput)
#### Post date: [September 17, 2019, 11:44am UTC](https://discuss.elastic.co/t/filebeat-processor-add-kubernetes-metadata-is-not-working-with-input-type-log/199588/3 "2019-09-17T11:44:03Z")

</div>

@pmercado After adding **add\_host\_metdata** we only get the host info such as IP and hostname which is actually of filebeat pod, not of actual host.  
My only concern is that-  
Can we use **add\_kubernetes\_metadata** with input type **log**?

---

<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 15, 2019, 11:48am UTC](https://discuss.elastic.co/t/filebeat-processor-add-kubernetes-metadata-is-not-working-with-input-type-log/199588/4 "2019-10-15T11:48:05Z")

</div>

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