# Filebeats autodiscover on kubernetes doesn't collect logs from annotated pods

**URL:** <https://discuss.elastic.co/t/filebeats-autodiscover-on-kubernetes-doesnt-collect-logs-from-annotated-pods/304018>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 5, 2022, 10:19am UTC](https://discuss.elastic.co/t/filebeats-autodiscover-on-kubernetes-doesnt-collect-logs-from-annotated-pods/304018 "2022-05-05T10:19:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Kovacic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ivan_kovacic/32/105268_2.png) [@Ivan\_Kovacic](https://discuss.elastic.co/u/Ivan_Kovacic)\
**Post date:** [May 5, 2022, 10:19am UTC](https://discuss.elastic.co/t/filebeats-autodiscover-on-kubernetes-doesnt-collect-logs-from-annotated-pods/304018/1 "2022-05-05T10:19:18Z")

</div>

Hi,  
I have an issue with filebeat when trying to collect logs from annotated pods, i have been following the documentation but without success. I am using filebeats 7.17 on kubernetes v1.21.5.  
This is my filebeat configuration

```auto
      filebeat.autodiscover:
        providers:
          - type: kubernetes
            hints.enabled: true
            hints.default_config.enabled: false

      # filebeat.inputs:
      # - type: container
      # multiline:
      # type: pattern
      # pattern: '^\x1b\[[0-9;]+m'
      # negate: true
      # match: after
      # paths:
      # - /var/log/container/*-689-*.log
      # processors:
      # - add_kubernetes_metadata:
      # host: ${NODE_NAME}
      # matchers:
      # - logs_path:
      # logs_path: "/var/log/containers/"
      output.logstash:
        hosts: ["logstash-logstash-headless.logging:5044"]

```

and i have annotated the pods i want to harvest logs from with

```auto
co.elastic.logs/enabled: "true"

```

When i tried with autodiscover with default\_config.enabled as false, i can see that filebeats registers node, but all i get is "Non-zero metrics in the last 30s" and nothing can be seen from kibana.

If I try with autodiscover, but with using templates i can get the logs in kibana, same as if i go with filebeat.inputs for container (the code comented out). Only that way is tedious to maintain, since every newly created pod (whether a new project or w/e, the filebeat config needs to be updated).

Am i doing something obviously wrong and can't pinpoint it, or is the functionality broken?

---

<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:** [June 2, 2022, 12:19pm UTC](https://discuss.elastic.co/t/filebeats-autodiscover-on-kubernetes-doesnt-collect-logs-from-annotated-pods/304018/2 "2022-06-02T12:19:28Z")

</div>

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