Background:
I’m following a guide to configure Filebeat in Kubernetes for parsing JSON logs. The guide suggests using autodiscover to detect and configure the inputs automatically.
Guide: https://www.elastic.co/guide/en/beats/filebeat/current/running-on-kubernetes.html#_parsing_json_logs
I’m encountering an error with Filebeat while trying to configure it in a Kubernetes environment to parse JSON logs. The error message I’m seeing is:
"Exiting: no modules or inputs enabled and configuration reloading disabled. What files do you want me to watch?"
Configuration:
Here’s the relevant part of my Filebeat ConfigMap:
apiVersion: v1
kind: ConfigMap
metadata:
name: filebeat-config
namespace: kube-system
labels:
k8s-app: filebeat
data:
filebeat.yml: |-
filebeat.autodiscover:
providers:
- type: kubernetes
node: ${NODE_NAME}
hints.enabled: true
hints.default_config:
type: container
paths:
- /var/log/containers/*${data.kubernetes.container.id}.log
processors:
- add_cloud_metadata:
- add_host_metadata:
setup.template.name: "aks-pre"
setup.template.pattern: "aks-pre-*"
output.elasticsearch:
hosts: ['${ELASTICSEARCH_HOST:elasticsearch}:${ELASTICSEARCH_PORT:9200}']
username: ${ELASTICSEARCH_USERNAME}
password: ${ELASTICSEARCH_PASSWORD}
index: aks-pre
Any insights or suggestions would be greatly appreciated.
Thanks in advance!