Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

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.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.