source hostname label
This commit is contained in:
@@ -12,11 +12,11 @@ local.file_match "system_logs" {
|
|||||||
|
|
||||||
loki.process "syslog" {
|
loki.process "syslog" {
|
||||||
stage.regex {
|
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 {
|
stage.labels {
|
||||||
values = {
|
values = {
|
||||||
hostname = "host"
|
hostname = "${host}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage.timestamp {
|
stage.timestamp {
|
||||||
@@ -29,6 +29,7 @@ loki.process "syslog" {
|
|||||||
forward_to = [loki.write.loki.receiver]
|
forward_to = [loki.write.loki.receiver]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
loki.write "loki" {
|
loki.write "loki" {
|
||||||
endpoint {
|
endpoint {
|
||||||
url = "<%= @ay_loki_url %>"
|
url = "<%= @ay_loki_url %>"
|
||||||
|
|||||||
Reference in New Issue
Block a user