You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
There does not appear to be a way to replace the value in a specific field using the replace stage, as suggested in the documentation.
I look into this, I found is source filed provided, then replace stage will replace the extracted labels with value of replace filed, if source filed is empty, then stage will replace the log with the value of replace filed in config.
and extracted labels will not be passed to client(Loki/log client), that's the reason that you saw {job="my-stdin-logs", level="info"} rather than {job="my-stdin-logs", level="xxxxx"}
.
it not bug ,https://grafana.com/docs/loki/latest/clients/promtail/pipelines/#pipeline
Parsing stages parse the current log line and extract data out of it. The extracted data is then available for use by other stages
replace is one of parsing stages.
Describe the bug
There does not appear to be a way to replace the value in a specific field using the replace stage, as suggested in the documentation.
This could very well be an issue with my config -- I wouldn't be surprised -- but I think I followed the gist of what is in the documentation at https://grafana.com/docs/loki/latest/clients/promtail/stages/replace/ .
To Reproduce
Steps to reproduce the behavior:
docker run --rm --entrypoint bash -it grafana/promtail:2.2.1
echo -n "lvl=info" | promtail --stdin --dry-run --config.file /tmp/promtail.yaml --log.level debug 2>&1
Expected behavior
I expected the output to include
level=xxx
.Environment:
Screenshots, Promtail config, or terminal output
Note the
level="info"
andlvl=info
below:If you drop the
source: level
from the config file you'll see:where it replaces the entire output.
The text was updated successfully, but these errors were encountered: