Correct config to parse GEOJSON information

Hi, I am trying to use geojson information to be able to show a forecast temperature data graph.
But I am not able to find the correct telegraf config.

The geojson can be found here:
https://dataset.api.hub.geosphere.at/v1/timeseries/forecast/nowcast-v1-15min-1km?parameters=t2m&lat_lon=48.18790304225732%2C%2016.4005100685933&forecast_offset=0&output_format=geojson

I wanted to use timestamps and the data arrays to be used.

Here’s my config:
[[inputs.http]]

One or more URLs from which to read formatted metrics

urls = [“https://dataset.api.hub.geosphere.at/v1/timeseries/forecast/nowcast-v1-15min-1km?parameters=t2m&lat_lon=48.18790304225732%2C%2016.4005100685933&forecast_offset=0&output_format=geojson”]
data_format = “json_v2”
[[inputs.http.json_v2]]
measurement_name = “nowcastv1”
[[inputs.http.json_v2.object]]
path = “@this
timestamp_key = “timestamps”
timestamp_format = “rfc3339”
disable_prepend_keys = true
[inputs.file.json_v2.object.fields]
key = “float”
path = “@this.features.0.properties.parameters.t2m.data

Hi,

Are you aware of the openweathermap input plugin? It may be easier to use that versus trying to parse other JSON.

Arrays in JSON are tricky and even more so when you seem to want to align to arrays together. My suggestion is to use an external script that pulls down the file, and parses it however you want versus trying to get the json parser to merge these together. I have seen users use the xpath parser with arrays with some success.

1 Like

Great, thanks for the quick reply!
I will review both options.
Do you happen to have an example configuration on hand?