logstash配置为
input {
file {
type => "mysql-slow"
path => "/tmp/slows.log"
codec => multiline {
pattern => "^# Time:"
negate => true
what => "previous"
}
}
}
filter {
if [ type ] == "mysql-slow" {
grok {
match => { "message" => "SELECT SLEEP" }
add_tag => [ "sleep_drop" ]
}
if "sleep_drop" in [tags] {
drop {}
}
grok {
"message" => "(?m)^#\s+Time\s?.*\s+#\s+User@Host:\s+%{USER:user}\[[^\]]+\]\s+@\s+(?:(?<clienthost>\S*) )?\[(?:%{IPV4:clientip})?\]\s+Id:\s+%{NUMBER:row_id:int}\n#\s+Query_time:\s+%{NUMBER:query_time:float}\s+Lock_time:\s+%{NUMBER:lock_time:float}\s+Rows_sent:\s+%{NUMBER:rows_sent:int}\s+Rows_examined:\s+%{NUMBER:rows_examined:int}\n\s*(?:use %{DATA:database};\s*\n)?SET\s+timestamp=%{NUMBER:timestamp};\n\s*(?<sql>(?<action>\w+)([\w.*\W.*])*;)\s*$"
}
}
}
最后的数据展示出来是这样的,不进行分割字段
请问怎么解决