1
在我的logstash配置中,我需要使用多個模式。我的應用程序以3種模式生成日誌。我試圖使用數組爲多個模式,但它不工作。LOGSTASH過濾器|同一文件的多個模式
filter{
grok{
match=>{
"message"=>[
"\[%{TIMESTAMP_ISO8601:timestamp}\] COMMTRACE user=\[%{GREEDYDATA:userId}\]\, sessionId\=\[%{GREEDYDATA:sessionId}\]\, ip\=\[%{HOSTNAME:ip}\]\, event\=\[%{GREEDYDATA:event}\]",
"\[%{TIMESTAMP_ISO8601:timestamp}\] COMMTRACE user\=\[%{GREEDYDATA:user}\], sessionId\=\[%{GREEDYDATA:sessionId}\], ip\=\[%{IP:ip}\]\, type\=\[%{GREEDYDATA:type}\]\, msg\=\[%{GREEDYDATA:msg}\]"
]
}
}
}
請幫
您沒有在第二個模式(GREEDYDATA:user之後)內部轉義逗號,也許這是錯誤? –
和GREEDYDATA後的逗號:sessionId也是 –
謝謝@AndreaRomagnoli。它的工作現在 – niting