Support Questions

Find answers, ask questions, and share your expertise

Nifi SplitJson - how to split json array to individual recods?

avatar
New Contributor

Hi,

SplitJson processor accept as an input Json array of objects.

How to split json array into individual records using SplitJson processor?

Where can I check examples of "JsonPath Expression" for "SplitJson processor"

I checked documentation for "SplitJson"- but it not covers JsonPath Expressions.

Thanks.

5 REPLIES 5

avatar

If it is a flat structure you probably want : $.*
Or, if it is some part of a nested structure: $.firstpart.secondpart.*

avatar
Explorer

@dchaffey Hi After Array split I get 12 flowfiles, Now I want those flowfiles to use one by one, means when 1 flowfile will execute its complete process then only next flowfile should be sent ahead. I tried using wait and notify but didnt worked properly. Can you suggest something

avatar
New Contributor

I just used $.* to split the json array into individual records.

avatar
New Contributor

I use

 

JsonPath Expression 

 

[*]

 

avatar
New Contributor

I'm receiving an array of the Json objects like [{"key1":"value1", "key2":"value2"},{...},{...}], all what I'm doing is using SplitJson with the following expression.

AntonBV_1-1682596662885.png

 

If you have another structure of a Json your expression could be different, or you should use any transform(f.e. JoltTransform) at first.