hi,
I’m using the latest telegraf docker image and enabling the inputs.http to call a single url
the response is in json format so i chose date_format = “json”
I tried a combination of adding the json query and fields, tags etc but
the telegraf metric parser error. The http response is this json
[
{
"user_id": "usr_BJeB2mHGsQ",
"layer": 1,
"frequency": 1,
"createdAt": "2018-10-15T16:43:24.977Z",
"dow": [
0,
1,
2,
3,
4,
5,
6
],
"end": 1539673200,
"exceptions": [],
"id": "evt_HkSrhQrMiX",
"schedule_id": "skd_S1XH2QrGiQ",
"repeat": true,
"start": 1539586800,
"sid": "acc_HkH2QHGi7"
}
]
here is the error
E! [inputs.http]: Error in plugin: [url=https://url_redacted]: metric parse error: expected tag at offset 38: “[{"user_id":"usr_BJeB2mHGsQ","layer":1,"frequency":1,"createdAt":"2018-10-15T16:43:24.977Z","dow":[0,1,2,3,4,5,6],"end":1539673200,"exceptions":,"id":"evt_HkSrhQrMiX","schedule_id":"skd_S1XH2QrGiQ","repeat":true,"start":1539586800,"sid":"acc_HkH2QHGi7"}]”
Is there something in the telegraf config that’s required to over come the parsing issue?
I tried some of the troubleshooting steps found in the github issues like this Need help with parsing JSON with strings in Telegraf inputs.http · Issue #4650 · influxdata/telegraf · GitHub
but couldn’t get beyond the error i’m getting.
Thanks,