lots of stuff

This commit is contained in:
bee
2026-08-16 14:48:04 +02:00
parent c63db540e8
commit 49fa352476
45 changed files with 32520 additions and 93 deletions
+39 -2
View File
@@ -10,8 +10,17 @@ local.file_match "fail2ban" {
path_targets = [{"__path__" = "/var/log/fail2ban.log", job = "fail2ban", host = "beepi"}]
}
local.file_match "backup" {
path_targets = [{"__path__" = "/var/log/beepi-backup.log", job = "backup", host = "beepi"}]
}
local.file_match "varlog" {
path_targets = [{"__path__" = "/var/log/*.log", job = "varlog", "__path_exclude__" = "/var/log/fail2ban.log", host = "beepi"}]
path_targets = [{
"__path__" = "/var/log/*.log",
job = "varlog",
"__path_exclude__" = "/var/log/{fail2ban,beepi-backup}.log",
host = "beepi",
}]
}
loki.source.file "varlog" {
@@ -19,6 +28,34 @@ loki.source.file "varlog" {
forward_to = [loki.write.default.receiver]
}
loki.source.file "backup" {
targets = local.file_match.backup.targets
forward_to = [loki.process.backup.receiver]
}
loki.process "backup" {
forward_to = [loki.write.default.receiver]
stage.regex {
expression = `^\[(?P<ts>[^\]]+)\]\s(?P<backup_job>\w+):\s(?P<message>.*)$`
}
stage.labels {
values = {
backup_job = "",
}
}
stage.match {
selector = `{job="backup"} |~ "(?i)(FAILED|verify failed|refusing to sync|error)"`
stage.static_labels {
values = {
level = "error",
}
}
}
}
loki.source.file "fail2ban_source" {
targets = local.file_match.fail2ban.targets
forward_to = [loki.process.geoip.receiver]
@@ -58,4 +95,4 @@ loki.write "default" {
endpoint {
url = "http://loki:3100/loki/api/v1/push"
}
}
}