# How can I add kubernetes metadata for my cri-containerd pods

**URL:** <https://discuss.elastic.co/t/how-can-i-add-kubernetes-metadata-for-my-cri-containerd-pods/294706>\
**Category:** Beats\
**Tags:** docker, filebeat\
**Created:** [January 18, 2022, 2:49pm UTC](https://discuss.elastic.co/t/how-can-i-add-kubernetes-metadata-for-my-cri-containerd-pods/294706 "2022-01-18T14:49:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jianwu](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@jianwu](https://discuss.elastic.co/u/jianwu)\
**Post date:** [January 18, 2022, 2:49pm UTC](https://discuss.elastic.co/t/how-can-i-add-kubernetes-metadata-for-my-cri-containerd-pods/294706/1 "2022-01-18T14:49:43Z")

</div>

I am using filebeat 7.16.2 to collect containers stdout which run-time is containerd. MY kubernetes' versin v1.20.10, and containerd version is v1.19.0. Below is some of my filebeat.yaml

```auto
    filebeat.inputs:
    - type: log
      paths:
        - /var/log/containers/*/*/*.log
      exclude_files: ["filebeat","kube","cattle-system","metallb-system"]
      fields_under_root: true
      multiline.pattern: '^\s'
      multiline.match: after
      tail_files: false
      clean_removed: true
      processors:
        - add_kubernetes_metadata:
            in_cluster: true
            kube_config: /data/certs/kubeconfig 

```

I can collect logs but can not get kubernetes metadata, such as kubernetes namespaces, labels... How can I get the metadata? what wrong with my configuration?

---

<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:** [February 15, 2022, 4:49pm UTC](https://discuss.elastic.co/t/how-can-i-add-kubernetes-metadata-for-my-cri-containerd-pods/294706/2 "2022-02-15T16:49:45Z")

</div>

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