Can somebody show me how to format this?

I’ve tried a few different ways to do this and can’t get it quite right.

Given the data below, I’d like to build a Grafana graph that will use the network range as a variable, and a pre-built graph with the metrics “defined, used, touched, free” so I can quickly review subnets. I’ve tried using json, line protocol, graphite, and all I’ve managed to do is to get it all blob’d in with metrics in the form of “subnet_0_192.168.84.10-192.168.87.252_defined”.

I’m using a python script to push this out from telegraf using an exec input and then into influx.

I feel this should be easier that it has, but for whatever reason I can’t seem to get the data formatted in the proper way.

Thank you all!

root@dhcpserver-01:~# dhcpd-pools -c /var/log/dhcp-ldap.log --format=j
{
   "subnets": [
         { "location":"All networks", "range":"172.16.128.10 - 172.16.128.60", "defined":51, "used":0, "touched":1, "free":51 },
         { "location":"All networks", "range":"172.17.4.200 - 172.17.4.240", "defined":41, "used":0, "touched":0, "free":41 },
         { "location":"All networks", "range":"172.17.5.200 - 172.17.5.250", "defined":51, "used":3, "touched":29, "free":48 },
         { "location":"All networks", "range":"172.17.8.90 - 172.17.8.240", "defined":151, "used":81, "touched":42, "free":70 },
         { "location":"All networks", "range":"192.168.84.10 - 192.168.87.252", "defined":1011, "used":0, "touched":0, "free":1011 }
   ],
   "shared-networks": [
   ],
   "summary": {
         "location":"All networks",
         "defined":16614,
         "used":2012,
         "touched":2858,
         "free":14602
   }
}