- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Nifi Jsonpathreader is unable to extract the json array value on matched string
- Labels:
-
Apache NiFi
Created ‎07-17-2024 09:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Team,
I am facing the issue, while trying to fetch the value from jsonpathreader with avroschema attributes as below.
json reading from avro schema with jsonpathreader, and want to fetch home number with expression $.phoneNumbers[?(@.type=="home")].number. However, it is getting failed.
Please help on this.
{ "firstName": "John", "lastName": "Smith", "isAlive": true, "age": 25, "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021-3100" }, "phoneNumbers": [ { "type": "home", "number": "212 555-1234" }, { "type": "office", "number": "646 555-4567" } ], "children": [], "spouse": null }
Created ‎08-08-2024 02:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Kondaji wrote:Hi Team,
I am facing the issue, while trying to fetch the value from jsonpathreader with avroschema attributes as below.
json reading from avro schema with jsonpathreader, and want to fetch home number with expression $.phoneNumbers[?(@.type=="home")].number. However, it is getting failed. Socrates GM
Please help on this.
{ "firstName": "John", "lastName": "Smith", "isAlive": true, "age": 25, "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021-3100" }, "phoneNumbers": [ { "type": "home", "number": "212 555-1234" }, { "type": "office", "number": "646 555-4567" } ], "children": [], "spouse": null }
Hello,
I understand your frustration with this issue. It seems like the JSONPath expression you’re using should work, but there might be a few things to check:
Ensure JSONPathReader is correctly configured: Verify that the JSONPathReader is set up properly in your NiFi flow.
Check the Avro Schema: Make sure the Avro schema matches the structure of your JSON data.
Validate JSONPath Expression: Double-check the JSONPath expression $.phoneNumbers[?(@.type=="home")].number for any syntax errors.
Hope this will help you.
Best regards,
florence0239
