feat: massive refactoring...

This commit is contained in:
Xavier Morel
2025-11-09 00:45:00 +01:00
parent f9446df46d
commit 3245b6b89f
77 changed files with 3233 additions and 582 deletions

View File

@@ -0,0 +1,51 @@
{ ip, domainname, ... }:
{
out = ''
loki.relabel "mas_journal" {
forward_to = []
rule {
source_labels = ["__journal__priority_keyword"]
target_label = "level"
}
rule {
source_labels = ["__journal__SYSLOG_IDENTIFIER"]
target_label = "app"
}
}
loki.source.journal "mas_journal_scrape" {
forward_to = [loki.process.mas_router.receiver]
matches = "_SYSTEMD_UNIT=matrix-authentication-service.service"
relabel_rules = loki.relabel.mas_journal.rules
labels = {
service = "matrix-authentication-service",
host = "${domainname}",
host_ip = "${ip}",
}
}
loki.process "mas_router" {
stage.regex {
expression = "^(?P<timestamp>\\S+) (?P<level>\\S+) (?P<facility>\\S+) (?P<worker>\\S+) - (?P<message>.*)$"
}
stage.timestamp {
source = "timestamp"
format = "RFC3339Nano"
}
stage.labels {
values = {
level = "",
facility = "",
worker = "",
}
}
stage.output {
source = "message"
}
forward_to = [loki.write.grafana_loki.receiver]
}
'';
}