I'm running Promtail on Windows, using environment variables as described here: https://grafana.com/docs/loki/latest/clients/promtail/configuration/#use-environment-variables-in-the-configuration .
Here is my config.yaml:
client:
external_labels:
instance: ${FOO}
instance_id: ${BAR}
Now I set the two variables:
PS> $FOO="foo"
PS> $BAR="bar"
PS> echo $FOO
foo
PS> echo $BAR
bar
And then I start promtail with the flags --config.expand-env=true
to use environment variable references in the configuration file and --print-config-stderr
to get a quick output of the entire Promtail config.
However, the result is:
client:
external_labels: |
instance: ""
instance_id: ""
The variables are not replaced as expected.
(I also tried the same with $Env:FOO
and $Env:BAR
)
How can I achieve this?
Thanks