如果我在 Filebeat 模塊中使用 elasticsearch 攝取管道,并且看到以下陳述句: if: 'ctx.json?.userIdentity?.userName == null'
當 json.userIdentity.userName 等于 null 時,如果上面的 if 陳述句為真,鍵/值對會是什么樣子?{"json.userIdentity.userName":"null"}、{"json.userIdentity.userName":null} 或其他
另外,如果欄位不存在,那么key也等于null是否公平?
uj5u.com熱心網友回復:
這意味著管道處理器將在以下任何條件下執行:
// 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
}
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/425457.html
