- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Extract string nested in JSON value
- Labels:
-
Apache NiFi
Created on ‎10-29-2020 08:31 AM - edited ‎10-29-2020 02:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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"
}
Created ‎10-31-2020 07:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Refer the following template
https://drive.google.com/file/d/1e1q8xm-65WHHwGNsxyeRUSkRIw7ETO4B/view?usp=sharing
Created ‎10-31-2020 07:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Refer the following template
https://drive.google.com/file/d/1e1q8xm-65WHHwGNsxyeRUSkRIw7ETO4B/view?usp=sharing
Created on ‎11-02-2020 05:32 AM - edited ‎11-02-2020 05:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks @suraj143
I ended up using an UpdateRecord, but your approach with a JoltTransformJSON also works.
