Support Questions

Find answers, ask questions, and share your expertise

Need to append/add values to empty attributes for Json flow file in nifi

avatar
Contributor

Hi,

I want append values to some of empty attribute's values of flowfile from processor to existing processor of JSON data .Please can u assist on this asap.

Thanks

Adhi

1 ACCEPTED SOLUTION

avatar
Guru
7 REPLIES 7

avatar
Guru

avatar
Contributor

@Sonu Sahi Thank you very much. I have started my project recently and could you please help some sample examples with screenshots on how you are doing it. As i am new to this nifi and have to complete some activity to add values dynamically to empty json attributes .i.e suppose i have 40 fields , in that 25 fields having values and remaining 15 fields does not have values /empty. So with the help of another processor i want to append/update values to 15 empty attributes with values.

Please can i have some screenshots which you have done this please

Thanks

Adhi

avatar
Contributor

Hi @Sonu Sahi

It would be great if you share some screenshots on how to update/append the values for empty attributes of JSON data from other processor to existing processor dynamically as i need it for my project activities immediately . I am trying myself to do that as much as possible.

Thanks

Adhi

avatar
Guru

Hi @Adhishankar Nanjundan - looks like Muji has provided a good link below, that includes screenshots. Best of luck with your HDF/NiFi journey!

avatar
Contributor

Thank you . I am looking integrate/update multiple json fields with values from another processor .What is the best way to have dynamic fields.

Thanks

Adhi

avatar
Rising Star

Hi Abhi,

Below tutorial from Micheal goes through how to modify json using ReplaceText and/or updateAttribute Processor for twitter data.

https://community.hortonworks.com/articles/57803/using-nifi-gettwitter-updateattributes-and-replace....

Regards,

Muji

avatar
Contributor

jsonmerge.png jsonflowfilecontent.png Thanks a lot for the information ..i have google the above and able to get value for one attribute ..for example if i want to append/add values for n number of attributes which are all having null values and that needs to be updated dynamically ..how we can implement this as i am getting some of values from different processors like Http to put/append the values to empty attributes of json data..

I have tried merging two json flow file to one flowfile but the merge did not come with proper json format as it does not have comma separated in each json object of final flow file .Please refer jsonflowfilecontent.png and jsonmerge.png screenshots for more information.

How we can achive this one..Any idea which you people come across this scenrios earlier..

I.e i have 50 fields json format data where i have 30 fields having values and remaining 20 does not have values or empty or null.but i have values for those 20 columns from other processor like Jms queue and i will have to append the jms queue values to match the correct fields and update the values ..this process needs to be automated in nifi for my project ..i will get values for 20 fields and append to orginal json format data then send to kafka queue.

For this also do i need to follow the same procedure as below ??