Support Questions

Find answers, ask questions, and share your expertise

Apache NIFI SplitJson correct Json path expression.

avatar
Contributor

I am trying to split an array of record using SplitJson processor. But it fails to split the record. I am unable to find the correct expression for my json.
Here is my json

[
{"id":"30fb76fa-acbe-463b-830e-66f203bb0911","session_id":"804e8d5b-c266-92b7-4a1d-eed3650d3b4a","tag_name":"call"},
{"id":"23986d19-c91f-4d98-8cfd-08fb26c5ff85","session_id":"804e8d5b-c266-92b7-4a1d-eed3650d3b4a","tag_name":"direct-call"},
{"id":"7c374ae9-b96a-4383-85ce-6d45cbc5f8a4","session_id":"804e8d5b-c266-92b7-4a1d-eed3650d3b4a","tag_name":"homepage"},
{"id":"599bf3e0-2c76-4d38-8349-91cc04e34c33","session_id":"b8f17ef9-d7df-dec0-71e3-3ed28991d396","tag_name":"bounce"},
{"id":"55791f8a-3243-48b3-bb4a-70404a21148d","session_id":"b8f17ef9-d7df-dec0-71e3-3ed28991d396","tag_name":"homepage"}
]

I want split each record as seprate flowfile, means there will be five flow files.
What is the correct Json path expression ?

1 ACCEPTED SOLUTION

avatar
Master Mentor
@Vivek Singh

Try the following configuration in your splitJson processor:

65040-screen-shot-2018-04-06-at-80359-am.png

Thanks,

Matt

If you found this answer addressed your initial question, please take a moment to login and click "accept".

View solution in original post

2 REPLIES 2

avatar
Master Mentor
@Vivek Singh

Try the following configuration in your splitJson processor:

65040-screen-shot-2018-04-06-at-80359-am.png

Thanks,

Matt

If you found this answer addressed your initial question, please take a moment to login and click "accept".

avatar
Rising Star

try $.[*] or $[*]

http://jsonpath.herokuapp.com/ is a good place to practice

https://github.com/json-path/JsonPath for documentation