nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Bende <bbe...@gmail.com>
Subject Re: hey guys :) how to let NiFi "pass and parse parameters" through "HandleHttpRequest" ?
Date Fri, 18 Sep 2015 19:27:18 GMT
Hello,

Are you passing a parameter as a query parameter on the url
(somePath?param=value) ?

If so, HandleHttpRequest will put the query parameters into a FlowFile
attribute called http.query.string according to the documentation [1].
In your ExecuteSQL processor your, in the value of the query property you
could access ${http.query.string} and perform some additional expression
language operations on it to parse out a specific value [2].
Maybe something like ${http.query.string:replace('param=','')} which would
get "value" in the example above.

-Bryan

[1]
https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.standard.HandleHttpRequest/index.html
[2]
https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html


On Fri, Sep 18, 2015 at 12:23 PM, QXU <xuquji@gmail.com> wrote:

> I am a new user for this tools, right now I am creating a simple flow to
> access the database and do the select statement from the specific table.
>
> in the WHERE condition I want to use parameter do dynamic change. I know
> there is the a problem we cannot use ExecuteSQL processor directly use as
> "SOURCE", so I used "HandleHttpRequest" trigger SQL processor. Everything
> looks good and it works, and I can get an avro format file from destination
> path.
>
> Here is the question, in order to make the select statement works
> dynamically, once I hit the url, I want to pass the parameter, I tried
> multi
> times and it all failed, I also try to do research online but the source is
> very limited :(
>
> So, how to let Apache NiFi pass and parse parameters from
> "HandleHttpRequest"?
>
> <
> http://apache-nifi-developer-list.39713.n7.nabble.com/file/n2862/Screen_Shot_2015-09-17_at_6.png
> >
> <
> http://apache-nifi-developer-list.39713.n7.nabble.com/file/n2862/Screen_Shot_2015-09-17_at_6.png
> >
>
>
>
> --
> View this message in context:
> http://apache-nifi-developer-list.39713.n7.nabble.com/hey-guys-how-to-let-NiFi-pass-and-parse-parameters-through-HandleHttpRequest-tp2862.html
> Sent from the Apache NiFi Developer List mailing list archive at
> Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message