相关疑难解决方法(0)

Logstash config:检查是否存在布尔字段

使用Logstash 1.4.2,我的字段myfield是我的JSON文档中的布尔值.

要检查它是否存在(不关心布尔值)我用过:

if[myfield] { ...exists... } else { ...doesn't exist... } 
Run Code Online (Sandbox Code Playgroud)

测试此条件语句的结果是:

[myfield] does not exist   --> false
[myfield] exists, is true  --> true
[myfield] exists, is false --> false //expected true because the field exists
Run Code Online (Sandbox Code Playgroud)

它检查布尔值,而不是它的存在.

如何检查布尔字段是否存在?

logstash

7
推荐指数
1
解决办法
6750
查看次数

标签 统计

logstash ×1