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.

Take the attribute value (Jason Data) and replace a specific value in flow file (Jason data) content

Take the attribute value (Jason Data) and replace a specific value in flow file (Jason data) content

I have a flow file content like below

{ "atct": [ { "flag": "Y", "atct_no": 123456789, "debr" : "EAR" }, { "flag": "Y", "atct_no": 234567891, "debr" : "EYE" } ] }

And then I have an attribute Attr_X which has value - [ "2020202020", "1010101010"]

I would like to replace "atct_no" values in flow file content and I need it to look like (if possible with out splitting the flow file)


{ "atct": [ { "flag": "Y", "atct_no": 2020202020, "debr" : "EAR" }, { "flag": "Y", "atct_no": 1010101010, "debr" : "EYE" } ] }

3 REPLIES 3

Re: Take the attribute value (Jason Data) and replace a specific value in flow file (Jason data) content

Re: Take the attribute value (Jason Data) and replace a specific value in flow file (Jason data) content

Hi @Abdelkrim Hadjidj

Thank you very much for the quick reply. Now I did go through the update processor. The issue I am unable to figure out is, how to reference the array of Attribute values in update processor. To my initial question there are two records in Jason file and 2 values in attribute "Attr_X". So I want the first value of "atct_no" which is 123456789 to be replaced by 2020202020, and in the same way 234567891 to be replaced by 1010101010.

Thank you,

Raja

Re: Take the attribute value (Jason Data) and replace a specific value in flow file (Jason data) content

Hi @Raja Chowdary

You can add an UpdateAttribute to split the attribute into two attributes like this. Then you can use myatt1 or myatt2 separately.

64803-screen-shot-2018-03-23-at-51929-pm.png

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