Solved
Apache Nifi add json array name
Hello everyone,
i need your help. I am relatively new to nifi and need your help. I am using the processor ConsumeKafkaRecord_2_6 1.15.3 with the record writer json set record writer. The output is then an array without object name. Which processor or setup can I use to add an array name to the json output? I get this Output
[ {
"moving_id" : 17078440,
"store_id" : 9,
"gtin" : 4064813288877,
"qty" : -1.0,
"condition_indicator" : 40,
"issue_date" : 1656585240000,
"received_date" : 1656547200000,
"update_date" : 1656578057133
}, {
"moving_id" : 17078441,
"store_id" : 9,
"gtin" : 4064813288907,
"qty" : -1.0,
"condition_indicator" : 40,
"issue_date" : 1656585240000,
"received_date" : 1656547200000,
"update_date" : 1656578057133
} ]
and i need json file in this structur
{"stocks":
[ {
"moving_id" : 17078440,
"store_id" : 9,
"gtin" : 4064813288877,
"qty" : -1.0,
"condition_indicator" : 40,
"issue_date" : 1656585240000,
"received_date" : 1656547200000,
"update_date" : 1656578057133
}, {
"moving_id" : 17078441,
"store_id" : 9,
"gtin" : 4064813288907,
"qty" : -1.0,
"condition_indicator" : 40,
"issue_date" : 1656585240000,
"received_date" : 1656547200000,
"update_date" : 1656578057133
} ]}

