Hi everybody!
I have a Kubernets cluster deployed with RKE. When you deploy using RKE, the kubelet is not deployed as a pod, but it is deployed as a Docker container.
I want to collect logs from kubelet container and ignore the rest of containers logs.
I'm using the following configuratión on my filebeat.yaml but seems to ignore it and getting all containers logs.
Can someone tell me if there is something missing or perhaps I'm not configuring correctly.
Currente FIlebeat version: 7.6.2
filebeat.yml: |-
filebeat.config:
spool_size: 512
filebeat.inputs:
- type: docker
containers.ids:
- "*"
fields_under_root: true
tail_files: true
processors:
- add_docker_metadata: ~
- add_kubernetes_metadata:
kube_config: ~/.kube/config
- drop_event:
when:
regexp:
docker.container.name: "^k8s.*"
filebeat.autodiscover:
providers:
- type: docker
templates:
- condition:
contains:
docker.container.name: kubelet
config:
- type: container
paths:
- /var/lib/docker/containers/${data.docker.container.id}/*.log
exclude_lines: ["^\\s+[\\-`('.|_]"] # drop asciiart lines
output.file:
path: "/tmp/filebeat"
filename: filebeat
Thanks for helping!