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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...