Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Apache NIFI SplitJson correct Json path expression.

Solved Go to solution

Apache NIFI SplitJson correct Json path expression.

Explorer

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

Accepted Solutions
Highlighted

Re: Apache NIFI SplitJson correct Json path expression.

Master Guru
@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
Highlighted

Re: Apache NIFI SplitJson correct Json path expression.

Master Guru
@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

Highlighted

Re: Apache NIFI SplitJson correct Json path expression.

Contributor

try $.[*] or $[*]

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

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

Don't have an account?
Coming from Hortonworks? Activate your account here