Created 05-25-2020 09:35 AM
updateAttribute processor config
and this is the output of AttributetoJson processor ....i want tags value in the list like ["UNIX01"]
Created 05-26-2020 05:26 AM
@renuu The solution you are looking for is:
${tags:unescapeJson()}
If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.
Thanks,
Steven @ DFHZ
Created on 06-04-2020 05:15 AM - edited 06-04-2020 05:17 AM
@renuu Create your attributes how you need them to be in UpdateAttribute.
Next use attributesToJson to combine the attributes you want, and put them together into a single json object. In this processor set to flowfile-attribute if you need to use them as attributes later. If you need to POST the json, use flowfile-content.
Once you have set your attributes in UpdateAttribute, test the flow and view the attributes, or the flowfile content. You may notice the strings are escaped. If they are escaped, and you need them to not be escaped, that is when you must use unescapeJson. You can use unescapeJson anywhere you are allowed to use expression language. You could use it in another UpdateAttribute process to make a new attribute that is unescaped. You can use it in replaceText if you want to unescape the content of the flowfile before posting.
Created 05-26-2020 05:26 AM
@renuu The solution you are looking for is:
${tags:unescapeJson()}
If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.
Thanks,
Steven @ DFHZ
Created on 05-26-2020 10:32 AM - edited 05-26-2020 11:54 AM
@stevenmatison thnax for reply ...but i have question ..at which processor we have to write this expression ...i have apply this below expression on updateAttribute processor ..but still i am not getting out
${tags:unescapeJson()}
please provide me the complete scenario..i meant where i have to write the tag property with value["unix02"] and this above expression .......
thanx in advance
Created 06-04-2020 02:58 AM
hi @stevenmatison ,
this tag is not working ...and we also want to send dictionary {"flow":"process"} in same processor ...
is it possible???
Created on 06-04-2020 05:15 AM - edited 06-04-2020 05:17 AM
@renuu Create your attributes how you need them to be in UpdateAttribute.
Next use attributesToJson to combine the attributes you want, and put them together into a single json object. In this processor set to flowfile-attribute if you need to use them as attributes later. If you need to POST the json, use flowfile-content.
Once you have set your attributes in UpdateAttribute, test the flow and view the attributes, or the flowfile content. You may notice the strings are escaped. If they are escaped, and you need them to not be escaped, that is when you must use unescapeJson. You can use unescapeJson anywhere you are allowed to use expression language. You could use it in another UpdateAttribute process to make a new attribute that is unescaped. You can use it in replaceText if you want to unescape the content of the flowfile before posting.