Custom log for Filebeat DaemonSet running on Kubernetes

Hi,
i deployed a filebeat daemon set

And i would like to use a custom folder, like /var/mylogs
I configure filebeat to read from "/var/mylogs" and create a volume. But it is not getting any data.
This is the config:

and create a volume like:
volumeMounts:
- name: config
mountPath: /etc/filebeat.yml
readOnly: true
subPath: filebeat.yml
- name: data
mountPath: /usr/share/filebeat/data
- name: varlibdockercontainers
mountPath: /var/lib/docker/containers
readOnly: true
- name: varlog
mountPath: /var/log
readOnly: true
- name: applog
mountPath: /var/mylogs
readOnly: true
volumes:
- name: config
configMap:
defaultMode: 0600
name: filebeat-config
- name: varlibdockercontainers
hostPath:
path: /var/lib/docker/containers
- name: varlog
hostPath:
path: /var/log
# data folder stores a registry of read status for all files, so we don't send everything again on a Filebeat pod restart
- name: data
hostPath:
path: /var/lib/filebeat-data
type: DirectoryOrCreate
- name: applog
hostPath:
path: /var/mylogs

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