【问题标题】:NiFi | Json Parsing using Nifi Expression尼菲 |使用 Nifi 表达式进行 Json 解析
【发布时间】:2017-01-23 09:45:29
【问题描述】:

我正在尝试使用 Nifi 表达式语言解析我的 json - jsonpath

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”中有点(“.”)。我如何逃脱那个角色?

【问题讨论】:

    标签: apache-nifi


    【解决方案1】:

    你应该可以使用括号来引用它,就像提到的here

    所以我相信您使用的 JsonPath 是 $.feedJobExecutionContexts.['trigger_category.test_shashi']

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-11
      • 2015-05-16
      • 2011-03-17
      • 1970-01-01
      • 1970-01-01
      • 2015-09-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多