在logstash的输出中,每行开头都会加上timestamp 因此,对于mysql slowlog和java log 多行输出格式,就显得画蛇添足了;不过,logstash提供了multiline 功能 filter { # 如果是以# Time开头的就开始新一行 if [type] == ‘slowlog‘ { multiline { what => next pattern => "^# Time:" # 如果是# [A-Za-z0-9_-]+@开头的合并到上一行 } multiline { what => previous negate => true pattern => "^# [A-Za-z0-9_-]+@" } } # match java log if [type] == ‘java‘ { multiline { pattern => "^%{TIMESTAMP_ISO8601} " negate => true what => previous } } }
logstash multiline 过滤 mysql slowlog 和java log
原文地址:http://3379770.blog.51cto.com/3369770/1885131