logstash 子(二級)字段過濾

logstash的數據源爲json,
部分數據

"level" => {
       "levelStr" => "ERROR",
       "level" => 40000
},
"type" => "community",

一、用某個字段作爲過濾條件

filter {
    if [type] != "community"{
        drop {}
    }
}

二、用某個二級字段作爲過濾條件

filter {
    if [level][levelStr] != "ERROR"{
        drop {}
    }
}

參考:
https://discuss.elastic.co/t/how-to-refer-to-subfield-in-logstash/79474

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章