0
我在filebeat.yml定義的多編解碼器如下面Filebeat多編解碼器在我的情況不工作
multiline.pattern: '^%{TIMESTAMP_ISO8601} '
multiline.negate: true
multiline.match: after
但它似乎並沒有被工作日誌爲多行獲得附加在一起,就像下面
日誌2017-05-07 22:29:43 [0] [pool-2-thread-1] INFO c.app.task.ChannelActiveCheckTask - ----
Inside checkIfChannelActive execution ----
對應的日誌的
單線存儲在多行後的彈性搜索解析
---- Inside checkIfChannelActive execution ---- 2017-05-09 08:16:13 [0] [pool-2-thread-1] INFO
XYZZ - XYZ :: XYZ 2017-05-09 08:16:13 [0] [pool-2-thread-1] INFO XYZ - XYZYZZ
由於上述不工作,我使用下面的多模式,但它不工作也嘗試過
multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}'
下面是我logstash.conf
input {
beats {
port => 5044
}
}
filter {
mutate {
gsub => ["message", "\n", " "]
}
grok {
match => [ "message", "%{TIMESTAMP_ISO8601:timestamp} [%{NOTSPACE:uid}] [%
{NOTSPACE:thread}] %{LOGLEVEL:loglevel} %{DATA:class}-%{GREEDYDATA:message}" ]
overwrite => [ "message" ]
}
date {
match => [ "timestamp" , "yyyy-MM-dd HH:mm:ss" ]
target => "@timestamp"
}
if "_grokparsefailure" in [tags] {
drop { }
}
}
output {
elasticsearch {
hosts => localhost
index => "%{type}-%{+YYYY.MM.dd}"
}
}
誰能幫我解決這個問題?