apiVersion: v1
kind: ConfigMap
metadata:
  name: fluent-bit-config
  labels:
    app: fluent-bit
    chart: fluent-bit-2.4.2
    heritage: Helm
data:
  fluent-bit-service.conf: |-
    [SERVICE]
        Flush        1
        Daemon       Off
        Log_Level    info
        Parsers_File parsers.conf
        Parsers_File parsers_custom.conf

  fluent-bit-input.conf: |-
    [INPUT]
        Name             tail
        Path             /var/log/containers/sm-*NAMESPACE*.log
        Parser           docker
        Tag              kube.*
        Refresh_Interval 5
        Mem_Buf_Limit    128MB
        Skip_Long_Lines  On


  fluent-bit-filter.conf: |-
    [FILTER]
        Name                kubernetes
        Match               kube.*
        Kube_Tag_Prefix     kube.var.log.containers.
        Kube_URL            https://kubernetes.default.svc:443
        Kube_CA_File        /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        Kube_Token_File     /var/run/secrets/kubernetes.io/serviceaccount/token
        Keep_Log            On
        Merge_Log           On
        K8S-Logging.Parser  On
        K8S-Logging.Exclude On

    [FILTER]
        Name        record_modifier
        Match       kube.*
        Remove_key  log


  fluent-bit-output.conf: |-

    [OUTPUT]
        Name            es
        Match           kube.*
        Host            elasticsearch-master
        Port            9200
        Retry_Limit     False
        HTTP_User       REP_ES_USER
        HTTP_Passwd     REP_ES_PASS
        Logstash_Format True
        Logstash_Prefix fluent-bit-NAMESPACE



  fluent-bit.conf: |-
    @INCLUDE fluent-bit-service.conf
    @INCLUDE fluent-bit-input.conf
    @INCLUDE fluent-bit-filter.conf
    @INCLUDE fluent-bit-output.conf

  parsers.conf: |-
    [PARSER]
        Name        panic
        Format      regex
        Regex       panic*
        Time_Key    time