ElasticSearch接收管道空值问题

bqucvtff  于 2022-12-29  发布在  ElasticSearch
关注(0)|答案(1)|浏览(128)

如果我在Filebeat模块中使用elasticsearch摄取管道,并且看到以下语句:如果:'ctx.json?.用户身份?.用户名==空'
当json.userIdentity.userName等于null时,如果上面的if语句为真,键/值对将是什么样子?{“json.userIdentity.userName”:“null”}、{“json.userIdentity.userName”:null}或其他值
另外,如果字段不存在,那么键也等于null,这样说公平吗?
此问题已回答并已关闭

bgtovc5b

bgtovc5b1#

这意味着流水线处理器将在以下任何条件下执行:

// no json key
{}

// null json key
{
   "json": null
}

// empty json key
{
   "json": {}
}

// null json.userIdentity key
{
   "json": {
      "userIdentity": null
   }
}

// empty json.userIdentity key
{
   "json": {
      "userIdentity": {}
   }
}

// null json.userIdentity.userName key
{
   "json": {
      "userIdentity": {
         "userName": null
      }
   }
}

相关问题