Splunk Search

json

vinod0313
Explorer

Hi 

I have a log like below which is having json


FEATURES={ "featureDetails":[ { "featureName":"TOKEN_VALIDATION", "addedIn":"1.0.7", "description":"This feature is used to Validate the JWT token" }, { "featureName":"REQUETS_VALIDATION", "addedIn":"1.0.7", "description":"This feature is used to Validate request URL" }, { "featureName":"REQUEST_PAYLOAD_VALIDATION", "addedIn":"1.0.7", "description":"This feature is used to Validate request body" }, { "featureName":"RESPONSE_PAYLOAD_VALIDATION", "addedIn":"1.0.7", "description":"This feature is used to Validate response body" }, { "featureName":"AOP", "addedIn":"1.0.6", "description":"This feature is used to check method execution time" }, { "featureName":"TIBCO_COMMUNICATOR", "addedIn":"1.0.8", "description":"This feature is used to connect Benefits service " }, { "featureName":"SECRETS_SECURE", "addedIn":"1.0.7", "description":"This feature is used to Validate SECRETS" } ], "versionHistory":[ { "versionNumber":"1.0.0", "featuresAdded":"Common Exception Handling Capability"}, { "versionNumber":"1.0.0", "featuresAdded":"Common Exception Handling Capability"} ] }


which is having two array one is featureDetails and naother one is versionHistory


i want table like below which should come from versionHistory array

versionNumber                                                                     featuresAdded

1.0.0                                                                                        Common Exception Handling Capabilit

1.0.0                                                                                        Common Exception Handling Capability

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

spath is the way to go:

| makeresults 
| eval FEATURES="{ \"featureDetails\":[ { \"featureName\":\"TOKEN_VALIDATION\", \"addedIn\":\"1.0.7\", \"description\":\"This feature is used to Validate the JWT token\" }, { \"featureName\":\"REQUETS_VALIDATION\", \"addedIn\":\"1.0.7\", \"description\":\"This feature is used to Validate request URL\" }, { \"featureName\":\"REQUEST_PAYLOAD_VALIDATION\", \"addedIn\":\"1.0.7\", \"description\":\"This feature is used to Validate request body\" }, { \"featureName\":\"RESPONSE_PAYLOAD_VALIDATION\", \"addedIn\":\"1.0.7\", \"description\":\"This feature is used to Validate response body\" }, { \"featureName\":\"AOP\", \"addedIn\":\"1.0.6\", \"description\":\"This feature is used to check method execution time\" }, { \"featureName\":\"TIBCO_COMMUNICATOR\", \"addedIn\":\"1.0.8\", \"description\":\"This feature is used to connect Benefits service \" }, { \"featureName\":\"SECRETS_SECURE\", \"addedIn\":\"1.0.7\", \"description\":\"This feature is used to Validate SECRETS\" } ], \"versionHistory\":[ { \"versionNumber\":\"1.0.0\", \"featuresAdded\":\"Common Exception Handling Capability\"}, { \"versionNumber\":\"1.0.0\", \"featuresAdded\":\"Common Exception Handling Capability\"} ] }"
| spath input=FEATURES output=versionHistory path=versionHistory{} 
| mvexpand versionHistory 
| spath input=versionHistory output=versionNumber path=versionNumber 
| spath input=versionHistory output=featuresAdded path=featuresAdded 
| fields versionNumber, featuresAdded
0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...