# How to config filebeat to collect containerd logs file in K8S?

**URL:** https://discuss.elastic.co/t/how-to-config-filebeat-to-collect-containerd-logs-file-in-k8s/259237
**Category:** Beats
**Tags:** filebeat
**Created:** [December 21, 2020, 9:53am UTC](https://discuss.elastic.co/t/how-to-config-filebeat-to-collect-containerd-logs-file-in-k8s/259237 "2020-12-21T09:53:35Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![hillbun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hillbun/32/81178_2.png) [@hillbun](https://discuss.elastic.co/u/hillbun)
#### Post date: [December 21, 2020, 9:53am UTC](https://discuss.elastic.co/t/how-to-config-filebeat-to-collect-containerd-logs-file-in-k8s/259237/1 "2020-12-21T09:53:36Z")

</div>

* * *

## apiVersion: v1 kind: ConfigMap metadata: name: filebeat-inputs namespace: kube-system labels: k8s-app: filebeat data: kubernetes.yml: |- - type: container symlinks: true paths: - '/var/log/containers/\*.log' processors: - add\_kubernetes\_metadata: in\_cluster: true - decode\_json\_fields: fields: ['message'] target: json

apiVersion: apps/v1  
kind: DaemonSet  
metadata:  
name: filebeat  
namespace: kube-system  
labels:  
k8s-app: filebeat  
spec:  
selector:  
matchLabels:  
k8s-app: filebeat  
template:  
metadata:  
labels:  
k8s-app: filebeat  
spec:  
serviceAccountName: filebeat  
terminationGracePeriodSeconds: 30  
containers:  
- name: filebeat  
image: filebeat:7.6.1  
args: [  
"-c", "/etc/filebeat.yml",  
"-e",  
]  
env:  
- name: ELASTICSEARCH\_HOST  
value: elasticsearch  
- name: ELASTICSEARCH\_PORT  
value: "9200"  
securityContext:  
runAsUser: 0  
resources:  
limits:  
memory: 1024Mi  
requests:  
cpu: 100m  
memory: 100Mi  
volumeMounts:  
- name: config  
mountPath: /etc/filebeat.yml  
readOnly: true  
subPath: filebeat.yml  
- name: inputs  
mountPath: /usr/share/filebeat/inputs.d  
readOnly: true  
- name: data  
mountPath: /usr/share/filebeat/data  
- name: varlogcontainers  
mountPath: /var/log/containers  
#mountPath: /var/lib/docker/containers  
readOnly: true  
volumes:  
- name: config  
configMap:  
defaultMode: 0600  
name: filebeat-config  
- name: varlogcontainers  
hostPath:  
path: /var/log/containers  
- name: inputs  
configMap:  
defaultMode: 0600  
name: filebeat-inputs  
- name: data  
hostPath:  
path: /var/lib/filebeat-data  
type: DirectoryOrCreate

I can find log files /var/log/containers/\*.log in filebeat pod, but no data is collected into ES.

---

<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: [January 18, 2021, 11:53am UTC](https://discuss.elastic.co/t/how-to-config-filebeat-to-collect-containerd-logs-file-in-k8s/259237/2 "2021-01-18T11:53:52Z")

</div>

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