Export file inside pod kubernetes

Hi,
i'm trying to export some file from pods inside my cluster k8s.
now i've that configmap :

apiVersion: v1
kind: ConfigMap
metadata:
  name: filebeat-config
  namespace: kube-system
  labels:
    k8s-app: filebeat
data:
  filebeat.yml: |-
    filebeat.config:
      #inputs:
        # Mounted `filebeat-inputs` configmap:
        #path: ${path.config}/inputs.d/*.yml
        # Reload inputs configs as they change:
        #reload.enabled: false
      modules:
        path: ${path.config}/modules.d/*.yml
        # Reload module configs as they change:
        reload.enabled: false

    # To enable hints based autodiscover, remove `filebeat.config.inputs` configuration and uncomment this:
    filebeat.autodiscover:
      providers:
        - type: kubernetes
          templates:
            - condition:
                - and:
                  - has_fields: ['app.kubernetes.io/name']
                  - equals:
                      app.kubernetes.io/name=app1
              config:
                - prospectors:
                  paths:
                    - /tmp/access_log.log
                  tags: ["access_log"]
    processors:
      - add_kubernetes_metadata:
          in_cluster: true

    #output.elasticsearch:
      #hosts: ['${ELASTICSEARCH_HOST:elasticsearch}:${ELASTICSEARCH_PORT:9200}']
      #username: ${ELASTICSEARCH_USERNAME}
      #password: ${ELASTICSEARCH_PASSWORD}
    output.logstash:
      hosts: ['192.168.2.10:5043']

but i've that error inside filebeat pods when starting :

2021-10-01T10:45:17.862Z    ERROR    instance/beat.go:956    Exiting: error in autodiscover provider settings: error setting up kubernetes autodiscover provider: missing or │
│  invalid condition

but where i'm wrong?

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