Open sarvesh-lad opened 1 year ago
Template: airquality
Describe the problem Incorrect telegraf config
To Reproduce Steps to reproduce the behavior: Setup AirQuality telegraf agent an you will see error:
2023-02-22T23:20:30Z E! [inputs.http] Error in plugin: [url=AQI_URL]: instantiating parser failed: line 28: (json.Parser.TimeKey) cannot unmarshal TOML array into string (need slice)
The config section giving trouble:
## Data format to consume. data_format = "json" json_time_key = ["DateForecast"] json_time_format = "2006 01 02 " tag_keys = ["Category_Name", "ParameterName", "Latitude", "Longitude", "ReportingArea"] json_string_fields = ["ActionDay"]
Expected behavior It shouldn't be parsed as an array. It can be easily fixed by changing the time key and format.
## Data format to consume. data_format = "json" json_time_key = "DateForecast" json_time_format = "2006-01-02 " tag_keys = ["Category_Name", "ParameterName", "Latitude", "Longitude", "ReportingArea"] json_string_fields = ["ActionDay"]
Screenshots If applicable, add screenshots to help explain your problem.
How are you running InfluxDB?
Additional context The current output of the AQI request:
[ { "DateIssue": "2023-02-22 ", "DateForecast": "2023-02-22 ", "ReportingArea": "Dallas-Fort Worth", "StateCode": "TX", "Latitude": 32.767, "Longitude": -96.783, "ParameterName": "O3", "AQI": -1, "Category": { "Number": 1, "Name": "Good" }, "ActionDay": false, "Discussion": "https://www.tceq.texas.gov/airquality/monops/forecast_today.html" }, ... ]
Template: airquality
Describe the problem Incorrect telegraf config
To Reproduce Steps to reproduce the behavior: Setup AirQuality telegraf agent an you will see error:
2023-02-22T23:20:30Z E! [inputs.http] Error in plugin: [url=AQI_URL]: instantiating parser failed: line 28: (json.Parser.TimeKey) cannot unmarshal TOML array into string (need slice)
The config section giving trouble:
Expected behavior It shouldn't be parsed as an array. It can be easily fixed by changing the time key and format.
Screenshots If applicable, add screenshots to help explain your problem.
How are you running InfluxDB?
Additional context The current output of the AQI request: