Using an image because the paste didn’t work - but anyway, I’ve searched everywhere - my logs come in, everything is good, the link and syntax is fine. I’m just not getting ‘username’ label being passed
I did read through a bunch of the suggested posts before I made this one. Any suggestions would be great - even pointers to an exact page I can read more about how regex and the loki.process and new labels work, for docker?
// Welcome to the Grafana Alloy Configurator!
// You can paste your configuration here or start by using the configuration wizard or by loading an example from the catalog.
local.file_match "jellyfin_logs" {
path_targets = [
{
__path__ = "/share/Media/Data/docker/jellyfin/config/log/*log",
job = "jellylogs",
service = "jellyfin",
},
]
}
loki.source.file "jellyfin_logs" {
targets = local.file_match.jellyfin_logs.targets
forward_to = [loki.process.jellyfin_pipeline.receiver]
}
loki.process "jellyfin_pipeline" {
stage.regex {
expression = "Authentication request for \"(?P<username>[^\"]+)\""
}
stage.static_labels {
values = {
"msg" = "pipeline-hit",
}
}
stage.labels {
values = {
"user" = "username",
}
}
forward_to = [
loki.write.default.receiver,
]
}
loki.write "default" {
endpoint {
url = "http://192.168.1.6:3100/loki/api/v1/push"
}
}
I fixed it. Finally. It took forever. So many use cases for this stuff, but MY GOD. Someone please save this for posterity, because even the Grafana Alloy Configurator steered me wrong. I truly appreciate everyone’s attempt at help I finally have User being pulled in as a label in Grafana and setting up alerts now. Jesus, you have no idea how relieved I am now…
For the record, I couldn’t FIND any log telling me what was wrong. Grafana Alloy said nothing. Grafana said nothing. Loki said nothing. I was going MAD.