Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

Extract string nested in JSON value

avatar
Contributor

UPDATE: If you ever need to modify a record use this solution: https://community.cloudera.com/t5/Support-Questions/NiFi-UpdateRecord-processor-is-not-updating-JSON...

 

ORIGINAL question:

How can I extract a string nested in the value of a JSON? For the status key below, I only want the value Active, instead of MapRecord[{current_status=Active}].

 

Original JSON

 

{
  "indicator": "147.183.200.154",
  "timestamp": 1577742090000,
  "status": "MapRecord[{current_status=Active}]"
}

 

 

Desired final JSON

 

{
  "indicator": "147.183.200.154",
  "timestamp": 1577742090000,
  "status": "Active"
}

 

 

1 ACCEPTED SOLUTION

avatar
Explorer
2 REPLIES 2

avatar
Explorer

avatar
Contributor

Thanks @suraj143 

I ended up using an UpdateRecord, but your approach with a JoltTransformJSON also works.