Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Remove a json array in nifi using Jolt Transformation

Remove a json array in nifi using Jolt Transformation

New Contributor

Hi, I am trying to remove a json array from a json file in nifi with the help of JoltTransformation processor. Unable to perform the operation. Please look into it 

 

Input:

{

...

 

"student":[
{
"name":"likhita",
"id":"1"
},
{
"name":"ravi",
"id":"2"
},
{
"name":"ram",
"id":"3"
}

 

...

}

 

The required output is: The student json array being removed
{

...

...

}

 

The jolt expression I wrote is:

[
{
"operation": "remove",
     "spec": {
          "student": {
               "*": {
                    "name": "",
                    "id": ""
                     }
              }
        }
   }
]

 

The output generated is:

{

...

"student" : [ { }, { }, { } ]

...

}

 

Please help me understand how to remove the array student using Jolt Transformation in NIFI

 

Don't have an account?
Coming from Hortonworks? Activate your account here