Closed wellsgz closed 3 years ago
[[inputs.http]] ## One or more URLs from which to read formatted metrics interval = "30s" urls = ["http://A.B.C.D:8123/api/states/sensor.0x158d0004448ae5_humidity"] headers = {"Authorization" = "Bearer XXXX"} #HTTP method method = "GET" timeout = "15s" data_format = "json" name_override = "hass.airquality" tag_keys = [ "attributes", ] [inputs.http.tags] host="livingroom.airquality"
Telegraf 1.17.0 (git: HEAD 3f7a54c9)
❯ telegraf -config ./test.conf -test --debug 2020-12-26T12:43:55Z I! Starting Telegraf 1.17.0 2020-12-26T12:43:55Z D! [agent] Initializing plugins 2020-12-26T12:43:55Z D! [agent] Starting service inputs
hass.airquality,host=livingroom.airquality,url=http://A.B.C.D:8123/api/states/air_quality.xiaomi_miio_air_quality_monitor attributes_carbon_dioxide_equivalent=944,attributes_humidity=48.8,attributes_particulate_matter_2_5=0.1,attributes_temperature=28.2,attributes_total_volatile_organic_compounds=1.857 1608986636000000000 2020-12-26T12:43:55Z D! [agent] Stopping service inputs 2020-12-26T12:43:55Z D! [agent] Input channel closed 2020-12-26T12:43:55Z D! [agent] Stopped Successfully
http call return with result, e.g.
2020-12-26T12:59:26Z I! Starting Telegraf 1.17.0 2020-12-26T12:59:26Z D! [agent] Initializing plugins 2020-12-26T12:59:26Z D! [agent] Starting service inputs 2020-12-26T12:59:26Z D! [agent] Stopping service inputs 2020-12-26T12:59:26Z D! [agent] Input channel closed 2020-12-26T12:59:26Z D! [agent] Stopped Successfully
Did more test and figure out it's returning data issue, closing the issue.
Relevant telegraf.conf:
System info:
Telegraf 1.17.0 (git: HEAD 3f7a54c9)
Steps to reproduce:
Expected behavior:
❯ telegraf -config ./test.conf -test --debug 2020-12-26T12:43:55Z I! Starting Telegraf 1.17.0 2020-12-26T12:43:55Z D! [agent] Initializing plugins 2020-12-26T12:43:55Z D! [agent] Starting service inputs
Actual behavior:
http call return with result, e.g.
2020-12-26T12:59:26Z I! Starting Telegraf 1.17.0 2020-12-26T12:59:26Z D! [agent] Initializing plugins 2020-12-26T12:59:26Z D! [agent] Starting service inputs 2020-12-26T12:59:26Z D! [agent] Stopping service inputs 2020-12-26T12:59:26Z D! [agent] Input channel closed 2020-12-26T12:59:26Z D! [agent] Stopped Successfully
Additional info: