-
Notifications
You must be signed in to change notification settings - Fork 538
Closed
Labels
Description
What's wrong?
I've configured Alloy to emit debug logs:
logging {
level = "debug"
format = "logfmt"
}
This results in log entries like this:
ts=2025-04-30T11:31:48.998669Z level=debug msg="extracted data debug in logfmt stage" component_path=/ component_id=loki.process.local_logs component=stage type=logfmt "extracted data"="map[filename:/opt/homebrew/var/log/grafana-alloy.log hostname:homelab.localdomain job:grafana-alloy ts:2025-04-30T11:31:48.812936Z]"
Note the extracted data key in quotes which is invalid according to https://docs.appsignal.com/logging/formatting/logfmt.html: "Keys cannot contain spaces, but may contain fullstops (.), underscores (_) and hyphens (-)."
Alloy subsequently fails to decode its own output: ts=2025-04-30T11:31:48.998709Z level=error msg="failed to decode logfmt" component_path=/ component_id=loki.process.local_logs component=stage type=logfmt err="logfmt syntax error at pos 169 on line 1: unexpected '\"'"
Steps to reproduce
Process Alloy debug logs in a loki.process component with a stage.logfmt like this:
stage.logfmt {
mapping = {
"ts" = "",
}
}
System information
No response
Software version
No response
Configuration
Logs
Reactions are currently unavailable