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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...