apiVersion: v1
kind: ConfigMap
metadata:
  namespace: default
  name: csi-baremetal-logs-config
#  labels:
#    helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
data:
  fluent-bit.conf: |
    [SERVICE]
        Flush         5
        Log_Level     info
        Daemon        off
        Parsers_File  fluent-parsers.conf
        HTTP_Server   On
        HTTP_Listen   0.0.0.0
        HTTP_Port     2020
    [INPUT]
        Name             tail
        Path             /var/log/csi.log
        DB               /var/log/flb.db
        Path_Key         filename
        Parser           csi-logs
        Mem_Buf_Limit    5MB
        Skip_Long_Lines  Off
        Refresh_Interval 5
        Tag              csi-baremetal
    [INPUT]
        Name             tail
        Path             /var/log/drivemgr.log
        DB               /var/log/flb.db
        Path_Key         filename
        Parser           csi-logs
        Mem_Buf_Limit    5MB
        Skip_Long_Lines  Off
        Refresh_Interval 5
        Tag              kubernetes_cluster-csi-baremetal
    [FILTER]
        Name             record_modifier
        Match            *
        Record pod_name ${POD_NAME}
        Record node_name ${NODE_NAME}
        Record namespace ${NAMESPACE}
    [OUTPUT]
        Name            es
        Match           *
        tls             Of
        tls             On
        HTTP_User
        HTTP_Passwd
        tls.verify      Off
        Type            logEvent
        Host
        Port
        Logstash_Format on
        Retry_Limit     False
        Logstash_Prefix kubernetes_cluster-csi-baremetal
  fluent-parsers.conf: |
    [PARSER]
        Name        csi-logs
        Format      json
        Time_Key    time
        Time_Format %Y-%m-%dT%H:%M:%S %z