How to base64 decode value of dynamic json array in NiFi?

Viewed 73

I want to base64 decode encoding string of json array property not using hard code!!

This array size is dynamic.

Is there the way of decoding value using JoltTransformJson in NiFi?

Input JSON

{
  "A": [
       {
         "CC" : "Encoded string",
         "DD" : "any string"
       },
       {
         "CC" : "Encoded string",
         "DD" : "any string"
       }
     ]
  "B": "any string"
}

Output JSON

{
  "A": [
       {
         "CC" : "Decoded string",
         "DD" : "any string"
       },
       {
         "CC" : "Decoded string",
         "DD" : "any string"
       }
     ]
  "B": "any string"
}
1 Answers

with NiFi you can use UpdateRecord processor for update a specific record,

this is the Official Guide - NiFi Record Path Guide.

you need to add base64Decode(/A.CC) and this base64Decode(/B) to your processor.

I leave you the link for a guide with examples and screenshots -> Example

Related