我在telegraf中使用httpjson插件 .
我的telegraf配置如下所示:
[[inputs.httpjson]]
name = "info_metric"
servers = ["http://server.port/application/admin/info.json"]
method = "GET"
response_timeout = "5s"
当我从浏览器中获取它时,Json本身看起来像这样:
{"git":{"branch":"release/app_27.x","commit":{"id":"23cs3f","time":"2017-10-18T13:55:01+0200"}}}
我从telegraf日志得到的错误消息:
2017-10-25T11:02:11Z E! Error in plugin [inputs.httpjson]: http_json_info_metric: must have one or more fields
1 回答
如果你看一下httpjson文档link here . 它提到只从JSON中提取数值 .
查看您的JSON,它没有提取任何数值,因此没有形成错误消息中所述的字段 .