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!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...