如何删除JSON的钥匙并将整个内容作为内容返回



我的属性员工的JSON值低于JSON:

{"testQuery": {"$set": {"name":"Harsh"} }}

我想将{"$set": {"name":"Harsh"} }发送到自定义的程序员作为flowfile内容而不是属性,需要执行以下操作,

  1. 从属性员工的JSON值中删除testQuery键,
  2. 将TestQuery的值转换为流file内容并返回。

我假设您的 employee属性在流文件中具有值:

{"testQuery": {"$set": {"name":"Harsh"} }}

流动以获取{"$set": {"name":"Harsh"} }作为流量文件内容:

1. ReplaceText       - to store attribute into content
   Replacement Value = ${employee}
2. EvaluateJsonPath  - to extract required json value and put into content
   Destination       = flowfile-content
   value             = $.testQuery

最新更新