Support Questions
Find answers, ask questions, and share your expertise

Nifi Nested JSON flowfile into multiple flowfiles with parent JSON

Nifi Nested JSON flowfile into multiple flowfiles with parent JSON

New Contributor

Hello,

 

I wanted to parse the following JSON file flow file

 

{
"vehicle_speed": 657,

"vehicle_temp": 99,

"sensor_level": 45,
"temp": [
{
"sensor_number": 0,
"sensor_description": "Exists",
"sensor_name": 43
},
{
"sensor_number": 1,
"sensor_description": "Exists",
"sensor_name": 31,
}
],
"timestamp": 161903601000


}

 

into two flow files ("temp" element value is dynamic and can contain different number of json not necessarily two as in this example)

 

{
"vehicle_speed": 657,

"vehicle_temp": 99,

"sensor_level": 45,
"sensor_number": 0,
"sensor_description": "Exists",
"sensor_name": 43,
"timestamp": 161903601000

}

 

and 

 

 

{
"vehicle_speed": 657,

"vehicle_temp": 99,

"sensor_level": 45,
"sensor_number": 1,
"sensor_description": "Exists",
"sensor_name": 31,
"timestamp": 161903601000}

1 REPLY 1

Re: Nifi Nested JSON flowfile into multiple flowfiles with parent JSON

Explorer

I think you can solve it with JOLT Transform.