I have been using influxDB as a datasource to build Grafana dashboard and now am trying to use an http api link that contain the below json file. The link is for example https://example:8080/cluster. Or if possible to use telegraf to get the extracted data and send the metrics to the influxDB.
{ “status”: “UP”, “test1”: {“status”:“UP”, “count”:“0”, “DateTime”:“”, “description”:“Admin basket”}, “test2”: {“status”:“DOWN”, “count”:“0”, “DateTime”:“”, “description”:“Workbasket App”}, “test3”: {“status”:“UP”, “count”:“0”, “DateTime”:“”, “description”:“workbasketer”} }
I would want to display in the dashboard each key test1, test2, test3 with green background when Status is “UP” and red background when status is “DOWN”. I currently use influxDb
[[inputs.http]] urls = ["http://example:8080//Cluster"] tagexclude = ["url", "host"] #Overwrite measurement name from default `http` to `cluster` ### name_override = "httppegacluster" data_format = "json_v2" [[inputs.http.json_v2]] [[inputs.http.json_v2.object]] path = "test1" [[inputs.http.json_v2.object]] path = "test2" [[inputs.http.json_v2.object]] path = "test3" [[inputs.http.json_v2.object]] path = "test4" [[inputs.http.json_v2.object]] path = "test5"
Currently am getting this output : But I want it to include test1, test2 and test3 … so that I can build my dashboard based on Up and Down from the status
Outputs for telegraf :
telegraf -config http.conf -test
http count="0",description="Workbasket Admin",minDateTime="",status="UP" 1671286903000000000 > http count="0",description="Workbasket eFormWriteFailure",minDateTime="",status="UP" 1671286903000000000 > http count="0",description="Workbasket CreateAppWait",minDateTime="",status="UP" 1671286903000000000 > http count="0",description="Workbasket default@RoS",minDateTime="",status="UP" 1671286903000000000 > http count="0",description="Workbasket BackgroundProcessing",minDateTime="",status="UP" 1671286903000000000