Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Jolt transformation in apache nifi

avatar
Explorer

Hi,

input:

{
"tags": [
{
"tag": "component",
"value": "memory"
},
{
"tag": "class",
"value": "os"
},
{
"tag": "target",
"value": "linux"
}
]
}

Expected output:

The tag component value should be assigned to parameter field.

{

"parameter": "memory"

}

Please help me out.

1 REPLY 1

avatar

Hi,

Try the following Jolt spec:

 

[
  {
    "operation": "shift",
    "spec": {
      "tags": {
        "*": {
          "tag": "tags.[#2].Parameter",
          "value": "tags.[#2].value"
        }
      }
    }
  }
]

If you find this helpful please accept solution.