NiFi - How to extract key value from a string to JSON
Hi,
I am new to NiIf and need your help please.
I have a HandleHttpRequest processor and want to get the URL parameters into JSON.
The URL looks similar to this:
http://mydomain.de/getsomedata?key1=value1&key2=value2
but may can also be:
http://mydomain.de/getsomedata?myVar1=myValue1&myVar2=value2&lang=DE
So No. of parameter and parameter names and values can change of course.
Now I need a processor that extracts any of key/value pairs from http.query.string into:
{
params: {
"key1":"value1",
"key2":"value2"
}
}
or for 2nd example:
{
params: {
"myVar1":"value1",
"myVar2":"value2",
"lang":"DE"
}
}
How can I achieve that? Is there any processor I can use or should I use ExecuteScript processor?

