I’m looking at moving some of my collection scripts for various apis to telegraf.
I have a json api that I pull, and I’d like to get some stats off it. Initially I’m getting everything…which includes history…all as fields. This isn’t needed.
Here’s teh json.
{
"week":13572129426,
"total":6120460648188,
"day":10737434940,
"servers":{
"server1":{
"week":4887999375,
"total":2351316601317,
"day":2053517969,
"daily":{
"2018-05-24":100:
"2018-05-26":0
},
"month":52044101954
},
"server2":{
"week":0,
"total":17262848955,
"day":0,
"daily":{
"2018-05-24":0,
"2018-05-24":0
},
"month": 87387234
},
"month": 4284972934
}
So ideally , I’d like to pull the totals ($.week, $.day, $.total, $.month
) as a whole (to one table), and then for each server: $.servers['server1'].week/day/total/month
etc to another table.
I guess my main points is I need a way of excluding $.servers['serverx'].daily
as the rest of the information would be fine.
Any pointers for this newbie?