It looks like what you have there is a JSON object inside a form encoded POST 
body, which is a little unusual. The header extraction won’t help you, since 
you’re looking to extract from the body, not the header. At the moment, nifi 
doesn’t handle the double encoding, but what you could do is either:

a. fix the posting API so it sends JSON as the body, without the form encoding, 
and then use EvaluateJsonPath.
b. use ExtractText to pull the entry content out of the body into an attribute 
for further processing.
c. use SplitContent to turn the incoming POSTs into FlowFiles just containing 
the JSON piece, a slightly less efficient version of this might also be 
possible with ReplaceText, if the split strings prove hard to define given any 
other unspecified content.
d. Write a custom processor which pulls out form-encoded POSTs to attributes.

Option a is more likely to be useful to you down the line, since I’m guessing 
you’ll want to do things like EvaluateJsonPath on the content of the entry 
object for different routing for example. A hybrid of b and a is also possible 
through c.

Hope that helps,
Simon

On 2 Jan 2016, at 11:40, BOUKRAA, Kacem 
<[email protected]<mailto:[email protected]>> wrote:

Hello.

So, i'm using ListenHTTP processor to listen to some POST requests comping from 
a push notification service.

I'm receiving something like this:
<Screen Shot 2016-01-02 at 12.36.41 PM.png>
​now, i want to use something to set the post attribute entry as a fiow 
attribute ($_POST["entry"]).
the ListenHTTP has this attribute:
<Screen Shot 2016-01-02 at 12.36.47 PM.png>
Is that helpful to se file attributes? can i have an example of the syntax to 
use in my case. is it only: entry? or i should use another syntax.

Thanks in advance
​

Reply via email to