使用Logstash 1.4.2,我有一个字段myfield
,它是我的JSON文档中的一个布尔值。Logstash config:检查是否存在布尔字段
要检查它是否存在(不关心布尔值),我用:
if[myfield] { ...exists... } else { ...doesn't exist... }
结果从测试这个条件语句是:
[myfield] does not exist --> false
[myfield] exists, is true --> true
[myfield] exists, is false --> false //expected true because the field exists
它正在检查布尔价值,而不是它的存在。
如何检查布尔型字段是否存在?
链接到github问题https://github.com/elastic/logstash/issues/1867 – spuder 2015-04-20 18:01:51