2017-09-04 57 views
0

在Logstash中解析了我的JSON后,我有以下字段。无法在Logstash中删除带有前缀的所有字段

parsedcontent.userinfo.appId 
parsedcontent.userinfo.deviceId 
parsedcontent.userinfo.id 
parsedcontent.userinfo.token 
parsedcontent.userinfo.type. 

我想使用过滤器删除所有这些字段。我可以做到这一点:

filter{ 
    mutate{ 
    remove_field => "[parsedcontent][userinfo][appId]" 
    } 
} 

但我必须写有相同的前缀多次字段名和我有很多这类领域。是否有任何过滤器可以轻松删除带前缀的字段?请指导。

回答

0

你可以使用通配符或正则表达式。

filter { 
    mutate { 
     remove_field => "[parsedcontent*]" 
    } 
}