2017-08-14 66 views
0

这是我的配置文件:为什么logstash“多行”过滤器无法正常工作?

input{ 
redis{ 
     data_type => "list" 
     key => "aas-redis-logback" 
     host => "my redis host" 
     port => "6379" 
     password => "my redis password" 
    # threads => 5 
    } 
stdin{}  
} 

filter{ 
    multiline{ 
      pattern => "^\[AAS\]" 
      negate => true 
      what => "previous" 
    } 

} 

output{ 
    elasticsearch{ 
     hosts => "168.2.8.88:9200" 
     index => "0814-multi-test" 
    } 
    stdout{codec => rubydebug} 
} 

,这是我的日志文件: enter image description here

这是我的输出: enter image description here

这似乎是多过滤器的“模式”没有工作,所有的日志消息已经放在一起。 为什么?

回答

0

将true改为“true”。 然后它变成

multiline{ 
     pattern => "^\[AAS\]" 
     negate => "true" 
     what => "previous" 
} 

它工作正常。

相关问题