I’m trying to feed Loki with journal logs. Minimal working config works kinda ok, but it drops all the important metadata and basicaly drops everything besides the log message itself.
loki.source.journal "journal" {
forward_to = [loki.write.default.receiver]
}
loki.write "default" {
endpoint {
url = "http://…/loki/api/v1/push"
}
}
Docs states that, those fields are loaded into the
All messages read from the journal include internal labels following the pattern of
__journal_FIELDNAMEand Alloy drops them before sending to the list of receivers specified inforward_to.
With labelmap rule I’m able to pass this data, but it then lands in “indexed labels”, while I would like to keep them in “structured metadata”.
loki.relabel "journal" {
forward_to = []
rule {
action = "labelmap"
regex = "__(.*)"
}
}
Is it somehow possible to have journald logs feed into the loki, with message as message and all other things in “structured metadata” instead of “indexed labels”?