Filebeat configuration file troubles

Hello, I have installed elasticsearch, kibana and filebeat on kubernetes cluster version 7.6.1 within separate namespace.
My main goal was gather logs from other two namespaces within this cluster.
But still I have troubles with filebeat configuration file. I need to read logs from all pods of these namespaces. I have tried many configs and unfortunately it doesn't work well (gathers logs only from one namespace and/or from few pods).
I am new in that direction, so I hope I made stupid mistake and You can help me)

Below is one of many configs I have tried:

    filebeat.autodiscover:
      providers:
        - type: kubernetes
          templates:
            - condition:
                contains:
                  kubernetes.namespace: "namespace-1"
              config:
                - type: container
                  paths:
                    - "/var/lib/docker/containers/${data.kubernetes.container.id}/${data.kubernetes.container.id}-json.log"
            - condition:
                contains:
                  kubernetes.namespace: "namespace-2"
              config:
                - type: container
                  paths:
                    - "/var/lib/docker/containers/${data.kubernetes.container.id}/${data.kubernetes.container.id}-json.log"

Thank you in advance)

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