嗨,我在使用 filebeat 和 logstash解析 kubernetes 容器多行时遇到了一些问题。kubernetes 日志文件位于 /var/log/containers/*.log 和 json 行结构中。
是不是我的配置有问题?我错过了什么?
filebeat.yml:
filebeat:
# List of prospectors to fetch data.
prospectors:
-
paths:
- /var/log/containers/*.log
fields: {log_type: containers}
ignore_older: 5m
symlinks: true
json.message_key: log
json.keys_under_root: true
json.add_error_key: true
multiline.pattern: '^\d{4}-\d{2}-\d{2}'
multiline.match: after
multiline.negate: true
document_type: kube-logs
registry_file: /var/log/containers/filebeat_registry
output:
logstash:
hosts: ["logstash-logging:5044"]
Run Code Online (Sandbox Code Playgroud)
logstash.conf:
input {
beats {
port => 5044
}
}
filter {
if [type] == "kube-logs" {
date {
match => ["time", "ISO8601"]
remove_field => …Run Code Online (Sandbox Code Playgroud)