apiVersion: v1
kind: ConfigMap
metadata:
  name: filebeat-config
  namespace: production
  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:
    output.elasticsearch:
      hosts: ['${ELASTICSEARCH_HOST:elasticsearch}:${ELASTICSEARCH_PORT:9200}']
    logging.json: true
    logging.metrics.enabled: true
    setup.dashboards.enabled: true
    setup.kibana.host: "http://kibana:5601"