- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to extract Text from JSON
- Labels:
-
Apache NiFi
Created ‎02-10-2017 09:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi I have a JSON:
{ "eventType": "E21",
"hGuid": "125345360514082014",
"aGuid": "227345360514082014",
"timestamp": 1486273085000,
"eventFields": { "save": { "greeting": "How can we help?", "actions": [{ "action": "Track", "displayText": "Recently Ordered." }], "actions": ["Hello", "Returns", "Ask?"] } }
}
I want to extract the whole data under eventFields as a text. How can I do that in Nifi?
Created ‎02-10-2017 09:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.standard.EvaluateJsonPa... $.eventFields should give you the content of the eventFields as a single text
Created ‎02-10-2017 09:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.standard.EvaluateJsonPa... $.eventFields should give you the content of the eventFields as a single text
Created ‎02-10-2017 09:19 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That does not work as it says cannot convert to scalar form
Created ‎02-10-2017 09:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try explicitly setting the Return Type as 'json' rather than 'auto-detect' or 'scalar'.
Created ‎02-10-2017 09:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
json-test.xml I tried this for your input json
