2017-08-14 70 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" 
} 

它工作正常。

相關問題