尼菲 | Json 使用 Nifi 表达式解析
NiFi | Json Parsing using Nifi Expression
我正在尝试使用 Nifi 表达式语言解析我的 json - json路径
https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#jsonpath
它使用“.”用于节点遍历。如果 json 其中有一个节点名称带有 '.'在里面。
下面是示例 json
{"feedName":"trigger_category.childfeed123",
"feedId":"eff68e0b-a9e6-4c11-b74f-53f161a47faf",
"dependentFeedNames":["trigger_category.test_shashi"],
"feedJobExecutionContexts":{"trigger_category.test_shashi":[{"jobExecutionId":23946,
"startTime":1485145059971,
"endTime":1485145111733,
"executionContext":{"feedts":"1485145061170"}}]},
"latestFeedJobExecutionContext":{"**trigger_category.test_shashi**":{"jobExecutionId":23946,
"startTime":1485145059971,
"endTime":1485145111733,
"executionContext":{"**feedts**":"1485145061170"}}}}
我正在尝试读取提要,但它的父节点 'trigger_category.test_shashi' 中有点 ('.')。我如何转义该字符?
您应该能够像提到的那样使用方括号引用它 here。
所以我相信您使用的 JsonPath 是 $.feedJobExecutionContexts.['trigger_category.test_shashi']
。
我正在尝试使用 Nifi 表达式语言解析我的 json - json路径
https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#jsonpath
它使用“.”用于节点遍历。如果 json 其中有一个节点名称带有 '.'在里面。
下面是示例 json
{"feedName":"trigger_category.childfeed123",
"feedId":"eff68e0b-a9e6-4c11-b74f-53f161a47faf",
"dependentFeedNames":["trigger_category.test_shashi"],
"feedJobExecutionContexts":{"trigger_category.test_shashi":[{"jobExecutionId":23946,
"startTime":1485145059971,
"endTime":1485145111733,
"executionContext":{"feedts":"1485145061170"}}]},
"latestFeedJobExecutionContext":{"**trigger_category.test_shashi**":{"jobExecutionId":23946,
"startTime":1485145059971,
"endTime":1485145111733,
"executionContext":{"**feedts**":"1485145061170"}}}}
我正在尝试读取提要,但它的父节点 'trigger_category.test_shashi' 中有点 ('.')。我如何转义该字符?
您应该能够像提到的那样使用方括号引用它 here。
所以我相信您使用的 JsonPath 是 $.feedJobExecutionContexts.['trigger_category.test_shashi']
。