Created 02-14-2017 06:23 PM
Hi, i have an UpdateAttribute processor that creates 2 attributes longitude and latitude as follows
longitude {line:getDelimitedField(9,'|')}
i am trying to add them into a url in the following InvokeHTTP processor with the following configuration but its not working
http://api.met.no/weatherapi/locationforecast/1.9/?lat=${latitude};lon=${longitude} Is this possible or have i gone about it incorrectly. The URL works when i enter in the longitude and latitude figures manually Thank you
Created 02-15-2017 08:17 PM
If you are using ${line:getDelimitedField(9,'|')} then there needs to be a flow file attribute called "line" that contains the string you want to evaluate.
Does your flow extract the contents of the flow file into an attribute called "line" ?
If not you could use ExtractText to do this.
Created 02-14-2017 08:23 PM
The URL property supports expression language so that should be fine. You may want to double check that the flow files have the attributes you expect. You could have a RouteOnAttribute that routes ${latitude:isEmpty():or(longitude:isEmpty())} to somewhere so that by the time it makes it to InvokeHttp you know you have both values, or you could just use a LogAttribute and check the logs.
Created 02-15-2017 06:54 PM
Hi @Bryan Bende. Thanks for the reply. I added a logAttribute and it shows there is no value for latitude or longitude. i dont know why its not working. The data i am using is from the data simulator in the trucking app. The previous processor routes the truck_geo_events to the updatettribute processor.
longitude {line:getDelimitedField(9,'|')} 2017-02-15 18:49:56.779|truck_geo_event|92|10|George Vetticaden|1594289134|Memphis to Little Rock Route 2|Normal|34.8|-92.09|1| This looks like it should work though?
Created 02-15-2017 08:17 PM
If you are using ${line:getDelimitedField(9,'|')} then there needs to be a flow file attribute called "line" that contains the string you want to evaluate.
Does your flow extract the contents of the flow file into an attribute called "line" ?
If not you could use ExtractText to do this.
Created 02-16-2017 12:21 PM
Hi, that makes sense. I used ExtractText and it worked, thanks for the help