logstash的数据源为json,
部分数据json
"level" => { "levelStr" => "ERROR", "level" => 40000 }, "type" => "community",
1、用某个字段做为过滤条件ide
filter { if [type] != "community"{ drop {} } }
2、用某个二级字段做为过滤条件code
filter { if [level][levelStr] != "ERROR"{ drop {} } }
参考:
https://discuss.elastic.co/t/how-to-refer-to-subfield-in-logstash/79474get