Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

NiFi | Json Parsing using Nifi Expression

avatar
New Member

I am trying to parse my json using Nifi Expression language - jsonpath

https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#jsonpath

Its uses '.' for node traversal. If json which has one node name with '.' in it.

Below is sample json

{"feedName":"trigger_category.childfeed123",
"feedId":"eff68e0b-a9e6-4c11-b74f-53f161a47faf",
"dependentFeedNames":["trigger_category.test_shashi"],
"feedJobExecutionContexts":{"trigger_category.test_shashi":[{"jobExecutionId":23946,
"startTime":1485145059971,
"endTime":1485145111733,
"executionContext":{"feedts":"1485145061170"}}]},
"latestFeedJobExecutionContext":{"**trigger_category.test_shashi**":{"jobExecutionId":23946,
"startTime":1485145059971,
"endTime":1485145111733,
"executionContext":{"**feedts**":"1485145061170"}}}}

I am trying to read feedts but its parent node 'trigger_category.test_shashi' has dot ('.') in it. How do i escape "."character?

1 ACCEPTED SOLUTION

avatar

Hi @Shashi Vish,

The following should be working :

$.feedJobExecutionContexts.['trigger_category.test_shashi']

Keep in mind to set 'return type' to 'json' in your EvaluateJson processor.

Hope this helps.

View solution in original post

2 REPLIES 2

avatar

Hi @Shashi Vish,

The following should be working :

$.feedJobExecutionContexts.['trigger_category.test_shashi']

Keep in mind to set 'return type' to 'json' in your EvaluateJson processor.

Hope this helps.

avatar
New Member

Thanks... It worked...