Created on
01-12-2020
10:53 AM
- last edited on
01-12-2020
10:33 PM
by
VidyaSargur
Hi,
I've a flow whose input is a ListenHTTP processor. When this processor receives a request, I'd like to get the "restlistener.remote.source.host" attribute from it. I've seen this attribute here: https://ddewaele.github.io/http-communication-with-apache-nifi/#ListenHTTP Could anyone tell me it this is possible? Is there any method like getAttribute to achieve this?
Thanks!
Created on 01-12-2020 11:01 AM - edited 01-12-2020 11:05 AM
What format is the data coming out of listenHttp? Maybe show an example.
Based on that data you will need to use an appropriate processor. For example; evaluatejson if json. Other types like text, csv, Avro, xml, parquet, etc have their own procs and readers.
To get existing attributes saved as a new name you use UpdateAttribute, or to use them in downstream procs you access the attributes as follows:
${restlistener.remote.host.source}
i recommend to list the queue and view the attributes then copy the name you want into the ${attribute} syntax.
Created 01-12-2020 11:05 AM
Hi Steven,
The next processor I'm using is EvaluateJSONPath
Created 01-12-2020 11:08 AM
For evaluate json you click the + and make a new attribute name:
newAttributeFromJsonObject
in the value you enter:
$.path.to.json.object