You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

技术需求:使用JOLT Transform提取JSON Payload的content部分

用JOLT Transform提取指定content字段的配置方案

输入JSON

{
  "snippet-format": "empty-snippet",
  "total": 361,
  "start": 1,
  "page-length": 5,
  "selected": "include",
  "results": [
    {
      "index": 1,
      "uri": "/DEV/xyz-xyzRecord/OS1.json",
      "path": "fn:doc(\"/SIT1/xyz-xyzRecord/AB1.json\")",
      "score": 0,
      "confidence": 0,
      "fitness": 0,
      "href": "/v1/documents?uri=%2FDEV%2FIxyz-xyzRecord%2FOS1.json&database=data-hub-DEV",
      "mimetype": "application/json",
      "format": "json",
      "matches": null,
      "extracted": {
        "kind": "array",
        "content": [
          {
            "xyz": "AB1"
          }
        ]
      }
    }
  ]
}

期望输出

[
  {
    "xyz": "AB1"
  }
]

对应的JOLT SPEC配置

[
  {
    "operation": "shift",
    "spec": {
      "results": {
        "0": {
          "extracted": {
            "content": "[]"
          }
        }
      }
    }
  }
]

说明

这个shift操作会定位到输入JSON中results数组的第一个元素,提取其extracted.content字段,并将该数组直接映射到输出的根节点,正好得到需要的结果。

内容的提问来源于stack exchange,提问作者Sushanth

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 17:30:04