apiVersion: v1
kind: ConfigMap
metadata:
  name: fluent-bit-config
  namespace: logging
  labels:
    k8s-app: fluent-bit
data:
  fluent-bit.conf: |
    [SERVICE]
        Flush         1
        Log_Level     info
        Daemon        off
        Parsers_File  parsers.conf

    [INPUT]
        Name              tail
        Tag               kube.*
        Path              /var/log/containers/*.log
        Parser            docker
        DB                /var/log/flb_kube.db
        Mem_Buf_Limit     5MB
        Skip_Long_Lines   On
        Refresh_Interval  10

    [FILTER]
        Name            kubernetes
        Match           *
        Merge_JSON_Log  On

    [OUTPUT]
        Name            forward
        Match           *
        Host            ${FLUENTD_HOST}
        Port            ${FLUENTD_PORT}
        Shared_Key      ${FLUENTD_SHARED_KEY}
        tls             on
        tls.verify      off
        tls.ca_file     /fluent-bit/certs/fluentd.crt
        tls.debug       3

  parsers.conf: |
    [PARSER]
        Name        docker
        Format      json
        Time_Key    time
        Time_Format %Y-%m-%dT%H:%M:%S.%L
        Time_Keep   On
        # Command      |  Decoder | Field | Optional Action
        # =============|==================|=================
        Decode_Field_As   escaped    log
