Skip to content
Snippets Groups Projects
Commit 48326fad authored by Jan David Mol's avatar Jan David Mol
Browse files

tweak logging

parent 250bfc9e
Branches
Tags
2 merge requests!8Work in progress adding publish distro,!7Add alloy for log forwarding
# see also https://grafana.com/docs/alloy/latest/tutorials/send-logs-to-loki/
loki.relabel "journal" {
forward_to = []
rule {
source_labels = ["__journal_priority"]
target_label = "level"
}
rule {
source_labels = ["__journal__hostname"]
target_label = "hostname"
}
rule {
source_labels = ["__journal__comm"]
target_label = "comm"
}
rule {
source_labels = ["__journal__systemd_unit"]
target_label = "systemd_unit"
}
rule {
source_labels = ["__journal_unit"]
target_label = "unit"
}
}
loki.source.journal "journal_scrape" {
forward_to = [loki.process.filter_logs.receiver]
format_as_json = true
relabel_rules = loki.relabel.journal.rules
}
loki.process "filter_logs" {
// stage.drop {
// source = ""
// expression = ".*Connection closed by authenticating user root"
// drop_counter_reason = "noisy"
//}
stage.drop {
source = "systemd_unit,unit"
expression = "serial-getty@ttyS0.service"
drop_counter_reason = "ignore ttyS0 errors"
}
forward_to = [loki.write.lcu_loki.receiver, loki.write.central_loki.receiver]
}
loki.write "lcu_loki" {
endpoint {
url = "http://loki.service.consul:3100/loki/api/v1/push"
// basic_auth {
// username = "admin"
// password = "admin"
// }
}
}
loki.write "central_loki" {
endpoint {
url = "http://logs.service.lofar-central.consul:3100/loki/api/v1/push"
// basic_auth {
// username = "admin"
// password = "admin"
// }
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment