Splunk Search

JSON formatting

ThyAbode
Loves-to-Learn

I have the below JSON feed that I can see from a straight search. I'm trying to get some stats especially for pools-availabilityState by name and pools-status.statusReason by name. Tried spath but it didnt not help. How I do this. TIA

 

{ [-]
clientSslProfiles: { [+]
}
deviceGroups: { [+]
}
httpProfiles: { [+]
}
iRules: { [+]
}
ltmPolicies: { [+]
}
networkTunnels: { [+]
}
pools: { [-]
/Common/Ex-pool: { [-]
activeMemberCnt: 0
availabilityState: offline
curPriogrp: 0
enabledState: enabled
highestPriogrp: 0
lowestPriogrp: 0
members: { [+]
}
mr.msgIn: 0
mr.msgOut: 0
mr.reqIn: 0
mr.reqOut: 0
mr.respIn: 0
mr.respOut: 0
name: /Common/Ex-pool
serverside.bitsIn: 0
serverside.bitsOut: 0
serverside.curConns: 0
serverside.maxConns: 0
serverside.pktsIn: 0
serverside.pktsOut: 0
serverside.totConns: 0
status.statusReason: The children pool member(s) are down
tenant: Common
totRequests: 0
}
/Common/F2F3: { [-]
activeMemberCnt: 1
availabilityState: available
curPriogrp: 0
enabledState: enabled
highestPriogrp: 0
lowestPriogrp: 0
members: { [+]
}
mr.msgIn: 0
mr.msgOut: 0
mr.reqIn: 0
mr.reqOut: 0
mr.respIn: 0
mr.respOut: 0
name: /Common/F2F3
serverside.bitsIn: 0
serverside.bitsOut: 0
serverside.curConns: 0
serverside.maxConns: 0
serverside.pktsIn: 0
serverside.pktsOut: 0
serverside.totConns: 0
status.statusReason: The pool is available
tenant: Common
totRequests: 0
}
/Common/2F2F: { [-]
activeMemberCnt: 1
availabilityState: available
curPriogrp: 0
description:
enabledState: enabled
highestPriogrp: 0
lowestPriogrp: 0
members: { [+]
}
mr.msgIn: 0
mr.msgOut: 0
mr.reqIn: 0
mr.reqOut: 0
mr.respIn: 0
mr.respOut: 0
name: /Common/2F2F
serverside.bitsIn: 0
serverside.bitsOut: 0
serverside.curConns: 0
serverside.maxConns: 0
serverside.pktsIn: 0
serverside.pktsOut: 0
serverside.totConns: 0
status.statusReason: The pool is available
tenant: Common
totRequests: 0
}
}
serverSslProfiles: { [+]
}
sslCerts: { [+]
}
system: { [+]
}
telemetryEventCategory: systemInfo
telemetryServiceInfo: { [+]
}
virtualServers: { [+]
}
}

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

In what way did spath not help? Did you specify the paths you wanted or did you just get everything in the JSON? Can you share what you have tried and say why it didn't give you what you wanted?

0 Karma

ThyAbode
Loves-to-Learn

The spath is giving me everything and I do not know how we can specify certain key-value pair for a table view for stats.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| spath pools.enabledState output=enabledState

This should work for enabledState. The issue might be if your key has a dot in it. Although you could extract pools first, then run spath on that

| spath pools output=pools
| spath input=pools
0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...