json 从Nifi中的特定流文件内容中提取值

ca1c2owp  于 2023-10-21  发布在  其他
关注(0)|答案(1)|浏览(140)

我有一个运行几个脚本的流程,并提供如下输出:

{
  "token_type": "Bearer",
  "expires_in": "3599",
  "ext_expires_in": "3599",
  "expires_on": "1696064476",
  "not_before": "1696060576",
  "resource": "https://management.com/",
  "access_token": "kVSiwZy0pwnXRbakA98b_pxQRHyjdF5jkXBcGtRdPtGlEn8GbvplFQM_8PtDKLdvHydhU3gRSDd_t22OfN3wiGyY9Rfiw3SL6sR4VdPseaOerrQq5Hx8yaqZQkbYL1OfsNieTUV31WM1ymxhbYLkgxjbao2EpzC1XbZX_6jnjPnA66lZIBw"
}
https://crtyu.net/ars/98d3-99c48f0c0165?sv=2018-03-28&sr=b&sig=6nakoARUgAhttps&st=2023-09-30T07%3A57%3A02Z&se=2023-09-30T2A02%3A02Z&sp
{
  "url": "https://ccswindows.net/armrep/fda8053c-2-466d-98d3-99c48f0c0165?sv=2018-03-28&sr=b&sig=6nakgAJ6f2%2BL1Lhdf%2BcksTxefYX7TDpf53%2B4UXo%3D&spr=https&st=2023-09-30T07%3A57%3A02Z&se=2023-09-30T20%3A02=r",
  "subscription": "c544",
  "is_billing_completed": true,
  "from_date": "2023-03-01",
  "to_date": "2023-03-02",
  "cost_type": "AmortiCost"
}

生产者的Kafka主题是摊销_计费成本摊销
从这个响应中,我只需要调用来生成一个文件的**'url'**。需要帮助获取URL作为属性。

bakd9h0s

bakd9h0s1#

您可以按照以下规范添加一个 JoltTransformJSON 处理器沿着:

[
  {
    "operation": "shift",
    "spec": {
      "url": ""
    }
  }
]

这将只提取url值。

相关问题