source hostname label
This commit is contained in:
@@ -12,11 +12,11 @@ local.file_match "system_logs" {
|
||||
|
||||
loki.process "syslog" {
|
||||
stage.regex {
|
||||
expression = `(?P[A-Z][a-z][a-z]\\s{1,2}\\d{1,2}\\s\\d{2}[:]\\d{2}[:]\\d{2})\\s(?P[\\w][\\w\\d\\.@-]*)\\s(?P.*)$`
|
||||
expression = `(?P<ts>[A-Z][a-z]{2}\s{1,2}\d{1,2}\s\d{2}:\d{2}:\d{2})\s(?P<host>[\w\.\@-]+)\s(?P<log>.*)$`
|
||||
}
|
||||
stage.labels {
|
||||
values = {
|
||||
hostname = "host"
|
||||
hostname = "${host}"
|
||||
}
|
||||
}
|
||||
stage.timestamp {
|
||||
@@ -29,6 +29,7 @@ loki.process "syslog" {
|
||||
forward_to = [loki.write.loki.receiver]
|
||||
}
|
||||
|
||||
|
||||
loki.write "loki" {
|
||||
endpoint {
|
||||
url = "<%= @ay_loki_url %>"
|
||||
|
||||
Reference in New Issue
Block a user