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
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