---
apiVersion: v1
kind: ConfigMap
metadata:
  name: filebeat-config
  namespace: monitoring
  labels:
    app: filebeat
data:
  filebeat.yml: |
    filebeat.inputs:
    - type: container
      paths:
        - /var/log/containers/*.log
      processors:
      - add_kubernetes_metadata:
          host: ${NODE_NAME}
          matchers:
          - logs_path:
              logs_path: "/var/log/containers/"

    output.elasticsearch:
      hosts: 'http://es-master.monitoring:9200'
      index: "container-%{[fields.log_type]}-%{[agent.version]}-%{+yyyy.MM.dd}" 

    setup.template.name: "container"
    setup.template.pattern: "container-*"
