This commit is contained in:
2026-03-30 16:09:02 +00:00
parent f0297ae6c5
commit dcb9651f42

View File

@@ -12,16 +12,16 @@ data:
loki.source.syslog "external_tcp" {
listener {
address = "0.0.0.0:1514"
protocol = "tcp"
syslog_format = "rfc3164"
use_incoming_timestamp = true
rfc3164_default_to_current_year = true
address = "0.0.0.0:1514"
protocol = "tcp"
syslog_format = "rfc3164"
use_incoming_timestamp = true
rfc3164_default_to_current_year = true
labels = {
job = "syslog"
source = "external"
role = "network"
job = "syslog",
source = "external",
role = "network",
}
}
@@ -30,16 +30,16 @@ data:
loki.source.syslog "external_udp" {
listener {
address = "0.0.0.0:1514"
protocol = "udp"
syslog_format = "rfc3164"
use_incoming_timestamp = true
rfc3164_default_to_current_year = true
address = "0.0.0.0:1514"
protocol = "udp"
syslog_format = "rfc3164"
use_incoming_timestamp = true
rfc3164_default_to_current_year = true
labels = {
job = "syslog"
source = "external"
role = "network"
job = "syslog",
source = "external",
role = "network",
}
}
@@ -48,33 +48,33 @@ data:
loki.relabel "syslog_labels" {
rule {
action = "replace"
action = "replace"
source_labels = ["__syslog_message_hostname"]
target_label = "hostname"
target_label = "hostname"
}
rule {
action = "replace"
action = "replace"
source_labels = ["__syslog_message_app_name"]
target_label = "app"
target_label = "app"
}
rule {
action = "replace"
action = "replace"
source_labels = ["__syslog_message_severity"]
target_label = "severity"
target_label = "severity"
}
rule {
action = "replace"
action = "replace"
source_labels = ["__syslog_message_facility"]
target_label = "facility"
target_label = "facility"
}
rule {
action = "replace"
action = "replace"
source_labels = ["__syslog_connection_ip_address"]
target_label = "sender_ip"
target_label = "sender_ip"
}
forward_to = [loki.write.default.receiver]