# Autodiscover with k8s labels

**URL:** <https://discuss.elastic.co/t/autodiscover-with-k8s-labels/206596>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [November 5, 2019, 11:21am UTC](https://discuss.elastic.co/t/autodiscover-with-k8s-labels/206596 "2019-11-05T11:21:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![whoatemyjam](https://avatars.discourse-cdn.com/v4/letter/w/5f9b8f/32.png) [@whoatemyjam](https://discuss.elastic.co/u/whoatemyjam)\
**Post date:** [November 5, 2019, 11:21am UTC](https://discuss.elastic.co/t/autodiscover-with-k8s-labels/206596/1 "2019-11-05T11:21:32Z")

</div>

Hi  
I am trying to use condition in filebeat autodiscover for kubernates labels and i get yaml error.  
There is no error in yaml when checked in yamlint.  
filbeat version : 6.8.3  
es version : 6.8.3

```
apiVersion: v1
data:
  filebeat.yml: |-
    filebeat.autodiscover:
      providers:
        - type: kubernetes
          templates:
            - condition:
               -equals.kubernates.labels.app: logapp
              config:
                - type: docker
                  containers.ids:
                    - "${data.kubernetes.container.id}"

    processors:
      - drop_event.when:
          or:
          - equals:
              kubernates.namespace.name: "filebeat"

    setup.template.name: "filebeat-openshift-%{[beat.version]}"
    setup.template.pattern: "filebeat-openshift-%{[beat.version]}-*"
    setup.template.overwrite: true

    output.elasticsearch:
      hosts: ['${ELASTICSEARCH_HOST:elasticsearch}:${ELASTICSEARCH_PORT:9200}']
      index: "filebeat-openshift-%{[beat.version]}-%{+yyyy.MM.dd}"

```

I have added label  
kubernetes.labels.app: logapp

to a pod and just want to get data for that pod using app label

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:** [December 3, 2019, 11:21am UTC](https://discuss.elastic.co/t/autodiscover-with-k8s-labels/206596/2 "2019-12-03T11:21:40Z")

</div>

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