#fluetd-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: fluentd-config
  labels:
    app: fluentd
    kubernetes.io/cluster-service: "true"
data:
  fluent.conf: |
    <filter **>
      @type record_transformer
      <record>
        cluster {{ .Values.vettingEnv.clusterName }}
      </record>
    </filter>

    <match **>
      @type elasticsearch
      hosts https://{{ .Values.configmodulePy.elasticSearchUrl }}

      user {{ .Values.configmodulePy.elasticSearchUsername }}
      password {{ .Values.configmodulePy.elasticSearchPassword }}

      ssl_version TLSv1_2

      include_timestamp true
      index_name "vetting-logs-{{ .Values.vettingEnv.clusterName }}"

      time_key @timestamp

      <buffer tag, time>
        @type memory
        timekey 60
        timekey_wait 0
      </buffer>
    </match>