Hi,
I'm trying to pull a multivalue field from a JSON array to get statistics from it. The data looks as follows:
"APIHEADERRESPONSE":{...specific information...
},
"SERVICES": [
{
"HTTPStatus":"200",
"ServRespCode":"Success",
"ServRespTime":"1200",
"ServRespCached":"Y",
"ServiceShortName":"Service1",
"DataSource":"Source1",
"ServiceURI":"Service1Url"
},
{
"HTTPStatus":"200",
"ServRespCode":"Success",
"ServRespTime":"1200",
"ServRespCached":"Y",
"ServiceShortName":"Service2",
"DataSource":"Service2Source",
"ServiceURI":"Service2URL"
},
{
"HTTPStatus":"200",
"ServRespCode":"Success",
"ServRespTime":"12",
"ServRespCached":"Y",
"ServiceShortName":"Service3",
"DataSource":"Service3Source",
"ServiceURI":"Service3URL"
}
]
Our data follows the structure of an initial block of identifying information, followed by specific details of further backend calls our APIs make. We are printing the results of those backend calls into an array in the JSON (services block) we print out to splunk.
However, it is not a standardized amount of elements within the array. We can have 1 to many different services printed, and it varies from event to event. Further, the order is not normalized either, so we have no idea which service will print first.
Is there a way for us to extract the details of a specific service without using regex? If we had multiple events, how would I get something like the median response time of service1? Is there a way we can use SPATH to get this information without relying on the expensive nature of regex?
... View more