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!

AI for AppInspect

We’re excited to announce two new updates to AppInspect designed to save you time and make the app approval ...

App Platform's 2025 Year in Review: A Year of Innovation, Growth, and Community

As we step into 2026, it’s the perfect moment to reflect on what an extraordinary year 2025 was for the Splunk ...

Operationalizing Entity Risk Score with Enterprise Security 8.3+

Overview Enterprise Security 8.3 introduces a powerful new feature called “Entity Risk Scoring” (ERS) for ...