---
apiVersion: v1
kind: ConfigMap
metadata:
  name: fluentd-config
  namespace: logging
data:
  fluent.conf: |
    <source>
      @type tail
      path /var/log/containers/*.log
      pos_file /var/log/fluentd-containers.log.pos
      tag kubernetes.*
      <parse>
        @type json
      </parse>
      read_from_head false
    </source>

    <filter kubernetes.**>
      @type kubernetes_metadata
      @id filter_kube_metadata
    </filter>

    <filter **>
      @type elasticsearch_timestamp_check
      subsecond_precision 3
    </filter>

    # Throw away what is not needed first

    #<match fluent.**>
    #@type null
    #</match>

    <match kubernetes.var.log.containers.**kube-system**.log>
      @type null
    </match>

    # Capture what is left
    <match **>
      @type elasticsearch
      host cloud.humio.com
      port 9200
      scheme https
      ssl_version TLSv1_2
      user <Your Humio index space here>
      password <Your API key here>
      logstash_format true
    </match>

