Created 02-06-2018 11:15 AM
Hi,
I had been automate get request based on user query param using nifi with help of InvokeHttp.Here is the example;
http://aaa.com/q="bigdata"&api_key=""
http://aaa.com/q="apple"&api_key=""
I did split text using line by line read and invoke http processor using fetch those response as json format. My question is before invokehttp processor, i want to extract those query param values those query values are static. I need to know which query param using i got response. Please give me some suggestion. It would much helpful.
Thanks.
Created on 02-06-2018 01:29 PM - edited 08-17-2019 09:02 PM
After split text processor use extract text processor and add new property with matching regex, then the extracted attribute will be added as the flowfile attribute.
Example:-
After split text you are having each address in a flowfile as like this http://aaa.com/q="bigdata"≈i_key="", now you want to know which query param value(ex:bigdata) has been used.
Then use extract text add new property
query_values
q="(.*?)"
output flowfile:-
Once the flowfile processed by extract text processor it matches the regex and adds the attribute query_values to the flowfile.
By this way you are going to know which query param values are used to get response.
.
If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.
Created on 02-06-2018 01:29 PM - edited 08-17-2019 09:02 PM
After split text processor use extract text processor and add new property with matching regex, then the extracted attribute will be added as the flowfile attribute.
Example:-
After split text you are having each address in a flowfile as like this http://aaa.com/q="bigdata"≈i_key="", now you want to know which query param value(ex:bigdata) has been used.
Then use extract text add new property
query_values
q="(.*?)"
output flowfile:-
Once the flowfile processed by extract text processor it matches the regex and adds the attribute query_values to the flowfile.
By this way you are going to know which query param values are used to get response.
.
If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.