apiVersion: v1
kind: ConfigMap
metadata:
metadata:
  name: "{{ template "fullname" . }}-config-{{ .Release.Time.Seconds }}"
  labels:
    app: {{ template "fullname" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
  annotations:
    "helm.sh/hook": pre-install,pre-upgrade
data:
  sumo-sources.json: |-
    {
      "api.version": "v1",
      "sources": [
        {
          "sourceType" : "LocalFile",
          "name": "kubernetes-localfile",
          "pathExpression": {{ default "/var/log/containers/*.log" .Values.sumologic.pathExpression | quote }},
          "multilineProcessingEnabled": {{ default false .Values.sumologic.multilineProcessingEnabled }},
          "automaticDateParsing": {{ default true .Values.sumologic.automaticDateParsing }},
          "category": {{ default "kubernetes" .Values.sumologic.categoryName | quote }},
          "forceTimeZone": {{ default false .Values.sumologic.forceTimeZone }}
        }
      ]
    }
