Support Questions

Find answers, ask questions, and share your expertise

Jolt transformation in apache nifi

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

Super Collaborator

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.