мы написали файл конфигурации для конвейера Logsta sh 7.6.2, который мы назвали kubernetes-internal .
Мы проверили синтаксис с помощью bin/logstash --config.test_and_exit -f ../kubernetes-internal/02-filter.conf
, и кажется, что в синтаксисе чего-то не хватает:
[FATAL] 2020-04-29 10:41:42.006 [LogStash::Runner] runner - The given configuration is invalid. Reason: Expected one of #, => at line 152, column 8 (byte 5565) after filter {
Глядя на эту часть кода, мы имеем:
...
else {
if [kubernetes][labels][version] != "v2" {
date {
match => [ "syslog_timestamp", "ISO8601" ]
remove_field => [ "syslog_timestamp" ]
}
}
prune {
whitelist_names => ["^message_csv$","^host$","^beat","^source$","^type$","^offset$","@timestamp","kubernetes"]
}
mutate {
add_tag => [ "haproxy-logs" ]
remove_tag => [ "_csvparsefailure" ]
}
}
else {
if "ambassador" in [kubernetes][labels][service] { #Line152
grok {
match => { "message" => '^%{TIMESTAMP_ISO8601:time} %{IP:clientip}:%{NUMBER:port} %{WORD:verb} %{NOTSPACE:request} HTTP/%{NUMBER:httpversion} %{NUMBER:http_status} %{NOTSPACE:response_flag} %{NUMBER:bytes_received} %{NUMBER:bytes_sent} %{NUMBER:request_time} \'%{NOTSPACE:X-Forwarded-for}\' \'%{NOTSPACE:X-OURDOMAIN-Api}\' \'%{DATA:agent}\' \'%{NOTSPACE:UUID}\' \'%{NOTSPACE:X-Forwarded-Client-Cert}\' \'%{NOTSPACE:authority}\' \'%{NOTSPACE:upstream_host}\'$' }
}
mutate {
convert => {
"http_status" => "integer"
"bytes_sent" => "integer"
"bytes_received" => "integer"
"request_time" => "integer"
}
...
Чего нам не хватает до сих пор?