Created 11-28-2016 10:00 AM
Hi,
I am using a InvokeHTTP to call a external rest api and then Extract a few values from the JSON response using EvaluateJSONPath
What I am not able to understand is, why are we doing the extract from flowfile-attributes and not flowfile-content
Comparing the terminology with flume (which I have used before), flowfile-attributes are the Event headers and flowfile-content is Event body
Then how is EvaluateJSONPath is extracting from header using EL
Thanks,
Avijeet
Created 12-02-2016 12:04 PM
Please note that the EvaluateJsonPath
Thus it extracts from content and places to content or attributes.
If you want to extract the headers from the response of InvokeHTTPRequest, you will use EvaluateJsonPath as described above, since the HTTP response header will be part of the json returned and thus part of the FlowFile content. The following post may be helpful:
If this answers your question, let me know by accepting the answer; else, let me know of any gaps or follow-up questions.
Created 12-02-2016 12:04 PM
Please note that the EvaluateJsonPath
Thus it extracts from content and places to content or attributes.
If you want to extract the headers from the response of InvokeHTTPRequest, you will use EvaluateJsonPath as described above, since the HTTP response header will be part of the json returned and thus part of the FlowFile content. The following post may be helpful:
If this answers your question, let me know by accepting the answer; else, let me know of any gaps or follow-up questions.
Created 12-02-2016 12:45 PM
Thanks @Greg Keys - I was under impression the we are extracting from attributes. Can you pls share any documentation which clearly explain the lifecycle of a Event/flowfile going through a dataflow and any best practices.
Created 12-02-2016 01:05 PM
This explains flowfiles:
This is a good overview of NiFI: https://nifi.apache.org/docs/nifi-docs/html/getting-started.html.
Each processor follows the same idea of flowfile = content + attributes. Following the links to each shows more specialized behavior for that processor in operating on flowfiles (which are passed from one processor to the next via connections)