Created 01-18-2017 11:34 AM
Is it possible to use Expression language in UpdateAttribute processor?
Not for the Property Value but for the Property Name?
My mission is to get Dynamic Tag names.. If my JSON has 2 tags.. say Tag_1 and Tag_2.. I want to change them (tag_name not tag_value) to some other name, can that be done ?
OR
if existing tag name cannot be renamed, can I add a new tag? but again, the name of the Tag cannot be hardcoded in NiFi..
Created 01-18-2017 01:58 PM
Want to get a detailed solution you have to login/registered on the community
Register/LoginCreated 01-18-2017 01:09 PM
Can you provide a little more detail on your use case? Are you trying to dynamically create new FlowFile Attributes or are you trying to update JSON tag names in the FlowFile content's JSON itself? The updateAttribute processor works with FlowFile Attributes using the expression language. The FlowFile's content is not read by this processor.
Created 01-18-2017 01:28 PM
UpdateAttribute will change the value of the JSON tag.. but it wont change the name of the Tag.. I am looking to change the name of the tag dynamically..
Like suppose in my JSON, i have a tag named CREDIT_FLAG with value 'C'.. I want the name of the tag to change from CREDIT_FLAG to say CR_FL.. assuming the data "CR_FL" is also present in our flow..
-----
and if the above cannot be done, can we create new FlowFile Attributes dynamically? or any other way
-----
Summary:
Change tag name "CREDIT_FLAG" to "CR_FL" in any possible way using NiFi built in processors
-----
Let me know if more clarification is required..
Created 01-18-2017 01:58 PM
Want to get a detailed solution you have to login/registered on the community
Register/LoginCreated 01-18-2017 08:02 PM
If there is a fixed mapping of names, you can use JoltTransformJSON to rename the fields. For more complex things (dynamic attribute creation), you can use ExecuteScript.
Created 01-19-2017 08:18 AM
there is no fixed mapping.. might go with Custom Processor to do all the tasks
Created 01-19-2017 08:16 AM
yes, you are right.. even if the attributes get created.. I have no way to further reference them.. I was looking to create statements in PutSQL but yes I wont be able to do it..