Member since
08-11-2017
21
Posts
1
Kudos Received
2
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
12649 | 12-06-2017 04:26 PM | |
26602 | 08-15-2017 12:18 PM |
01-25-2018
07:48 AM
@chris obia There was an issue with the repository. Using the former release worked for me.
... View more
01-02-2018
08:04 AM
I have JSON data like in the attached file and trying to extract some values and convert it to a new schema with some generated values: sampledata.txt {
"id": 2920236,
"sampling_rate": null,
"timestamp": "2017-12-22 15:05:31",
"location": {
"id": 944,
"latitude": "51.575",
"longitude": "6.981",
"country": "DE"
},
"sensor": {
"id": 1887,
"pin": "1",
"sensor_type": {
"id": 14,
"name": "SDS011",
"manufacturer": "Nova Fitness"
}
},
"sensordatavalues": [
{
"id": 1312395485,
"value": "116.03",
"value_type": "P1"
},
{
"id": 1312395486,
"value": "38.10",
"value_type": "P2"
}
],
"coord": {
"lon": 6.98,
"lat": 51.58
},
"weather": [
{
"id": 741,
"main": "Fog",
"description": "fog",
"icon": "50n"
},
{
"id": 701,
"main": "Mist",
"description": "mist",
"icon": "50n"
}
],
"base": "stations",
"main": {
"temp": 281.9,
"pressure": 1034,
"humidity": 100,
"temp_min": 281.15,
"temp_max": 282.15
},
"visibility": 9000,
"wind": {
"speed": 2.1,
"deg": 340
},
"clouds": {
"all": 75
},
"dt": 1513957800,
"sys": {
"type": 1,
"id": 4886,
"message": 0.0043,
"country": "DE",
"sunrise": 1513928193,
"sunset": 1513956338
},
"name": "Gladbeck",
"cod": 200
} |-- PM10 (which is the value of sensordatavalues where value_type=P1 )
|-- timestamp (which is timestamp)
|-- sensor_id (which is the id of sensordatavalues where value_type=P1 )
|-- is_rain (is endcodes as whether 1 or 0 depending on the value of weather.cod)
|-- wind_deg (which is weather.wind.deg)
|-- wind_speed (which is weather.wind.speed)
|-- humidity (which is weather.main.humidity)
|-- pressure (which is weather.main.pressure)
|-- temperature (which is weather.main.temp)
|-- lon (which is location.longitude)
|-- lat (which is location.latitude)
|-- season (which is a value between 1 and 4 depending on the month)
|-- is_rushHour (which is a value 1 or 0 depending on the time) Any ideas how to transform my data?
... View more
Labels:
- Labels:
-
Apache NiFi
12-22-2017
03:16 PM
1 Kudo
@Shu that did the trick! Many thanks for your help and your patience as well.
... View more
12-22-2017
02:24 PM
@Shu Could you show me the configuration off your Extract Content as Attribute Processor? I think thats the point where I'm struggling
... View more
12-22-2017
01:15 PM
@Shu I don't quiet understand that part because you mentioned extracting the content with an extract text processor? How did you implement that?
... View more
12-21-2017
11:09 AM
@Shu Thanks for you detailed reply. That seems very helpful to my porpuse. How did you attech the resulting content as attribute to the flow file?
... View more
12-20-2017
11:18 AM
Hi, I have some problems merging the response of a API call with InvokeHTTP to the orginal flow file. I tried to put the response as an attribute to the original file and sent it to an replace text processor. I set the Evaluation Mode to Entire Text and tried either prepend and append replacement strategy. In prepend mode the processor is just passing the attributes as new content and in append the processor is writing the original content to the flow files. Any ideas how to merge the both datasets?
... View more
Labels:
- Labels:
-
Apache NiFi
12-19-2017
01:42 PM
I'm trying to load weather data as http API request. Therefore I need to extract the geo information from an incoming JSON flowfile. This is my JSON data {
"id" : 590575476,
"sampling_rate" : null,
"timestamp" : "2017-12-19 13:23:20",
"location" : {
"id" : 1311,
"latitude" : "47.967",
"longitude" : "7.959",
"country" : "DE"
},
"sensor" : {
"id" : 2602,
"pin" : "1",
"sensor_type" : {
"id" : 14,
"name" : "SDS011",
"manufacturer" : "Nova Fitness"
}
},
"sensordatavalues" : [ {
"id" : 1291686812,
"value" : "25.87",
"value_type" : "P1"
}, {
"id" : 1291686813,
"value" : "15.63",
"value_type" : "P2"
} ]
} Any idea how to access latitude and longitude as attributes for the URL in the InvokeHTTP processor? http://api.openweathermap.org/data/2.5/weather?lat=${location.latitude}&lon=${location.longitude}&APPID=myapikey
... View more
Labels:
- Labels:
-
Apache NiFi
12-05-2017
11:15 AM
Didn't work either. Got the same error with the following service.
... View more