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.

how to pass LIST in invoked http post request

Solved Go to solution

how to pass LIST in invoked http post request

Explorer

 

 

renuu_0-1590424230192.png

 

     updateAttribute processor config

 

renuu_1-1590424290980.png

and this is the output of AttributetoJson processor ....i want tags value in the list like ["UNIX01"] 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted

Re: how to pass LIST in invoked http post request

Master Collaborator

@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

 


 


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

View solution in original post

Highlighted

Re: how to pass LIST in invoked http post request

Master Collaborator

@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.     

 


 


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

View solution in original post

4 REPLIES 4
Highlighted

Re: how to pass LIST in invoked http post request

Master Collaborator

@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

 


 


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

View solution in original post

Highlighted

Re: how to pass LIST in invoked http post request

Explorer

@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  

Highlighted

Re: how to pass LIST in invoked http post request

Explorer

hi @stevenmatison ,

 this tag is not working ...and we also want to send dictionary {"flow":"process"} in same processor ...

is it possible???

 

 

Highlighted

Re: how to pass LIST in invoked http post request

Master Collaborator

@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.     

 


 


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

View solution in original post

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