'Helm Loki Stack additional promtail config

I install loki and prometheus using helm. However, I would like to replace the logs in one place. I have used: helm show values grafana/loki-stack > loki-stack-values.yml to output the values and came to the following result:

loki:
  enabled: true
  isDefault: true

promtail:
  enabled: true
  config:
    lokiAddress: http://{{ .Release.Name }}:3100/loki/api/v1/push
      prometheusSpec:
        additionalScrapeConfigs:
          - match:
              selector: '{name="promtail"}'
              stages:
              # The regex stage parses out a level, timestamp, and component. At the end
              # of the stage, the values for level, timestamp, and component are only
              # set internally for the pipeline. Future stages can use these values and
              # decide what to do with them.
              - regex:
                  expression: '.*level=(?P<level>[a-zA-Z]+).*ts=(?P<timestamp>[T\d-:.Z]*).*component=(?P<component>[a-zA-Z]+)'



Actually, everything would work great. But my output is really weird so I try to add the the additionalScapeConfig

2022-05-06 18:31:55 
{"log":"2022-05-06T18:31:55,003 \u001b[36mDEBUG\u001b[m

So to the question:

How can I use helm install dlp-dev-loki grafana/loki-stack --values loki-stack-values.yml -n dev. and additional scape configs for promtail.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source