Getting Data In

Extract Json and Build a plot

jitin_ratra
New Member

I am looking to extract values from the Json to build out data to see what was the quote number that threw error. I am looking to build something like below. below is my Json

Region | Country | CustomerSet | Quote Number
EMEA | ZA | RC1390756 | 12729883

Message=Message :{
"Application": "checkoutro",
"UserAgent": "Mozilla/5.0",
"RouteTemplate": "api/{c}/{l}/{cs}/v3quote/addquotetoprofile/{quoteNumber}",
"RequestMethod": "POST",
"ControllerName": "V3Quote",
"ActionName": "AddQuoteToProfile",
"ActionArguments": {
"quoteNumber": 12729883,
"version": 1,
"source": 5,
"customerNumber": null
},
"ActionReturnTypeFullName": "System.Web.Http.IHttpActionResult",
"SessionId": "abc",
"LightweightProfile": {
"AccessGroup": "307b7c3e-e1a7-4366-9ed1-a77100b5973c",
"AccessGroupType": 0,
"ContentSegment": "bsd",
"Country": "ZA",
"CurrencyCode": "zar",
"CurrencyCultureInfo": null,
"CustomerSet": "RC1390756",
"DisplayCultureInfo": null,
"Language": "en",
"ProfileId": "f2fa479b-3224-4d42-83ba-520e7416d6ee",
"Region": "EMEA",
"SalesSegment": "CHN",
"SessionId": "abc",
"LocalizedCatalogId": 148,
"PricingTemplateId": 0,
"IsGlobalPortal": false,
"IsSiebelEnabledUsFedStore": false
}

Any help will be appreciatd here .

Tags (1)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@jitin_ratra

Can you please try this?

YOUR_SEARCH  | rex field=_raw "Message=Message :(?<json>.*)$" | eval _raw=json | kv | table LightweightProfile.Region LightweightProfile.Country LightweightProfile.CustomerSet ActionArguments.quoteNumber | rename "LightweightProfile.Region" as Region "LightweightProfile.Country" as Country "LightweightProfile.CustomerSet" as CustomerSet "ActionArguments.quoteNumber" as quoteNumber

My Sample Search:

| makeresults | eval _raw="Message=Message :{\"Application\": \"checkoutro\",\"UserAgent\": \"Mozilla/5.0\",\"RouteTemplate\": \"api/{c}/{l}/{cs}/v3quote/addquotetoprofile/{quoteNumber}\",\"RequestMethod\": \"POST\",\"ControllerName\": \"V3Quote\",\"ActionName\": \"AddQuoteToProfile\",\"ActionArguments\": {\"quoteNumber\": 12729883,\"version\": 1,\"source\": 5,\"customerNumber\": null},\"ActionReturnTypeFullName\": \"System.Web.Http.IHttpActionResult\",\"SessionId\": \"abc\",\"LightweightProfile\": {\"AccessGroup\": \"307b7c3e-e1a7-4366-9ed1-a77100b5973c\",\"AccessGroupType\": 0,\"ContentSegment\": \"bsd\",\"Country\": \"ZA\",\"CurrencyCode\": \"zar\",\"CurrencyCultureInfo\": null,\"CustomerSet\": \"RC1390756\",\"DisplayCultureInfo\": null,\"Language\": \"en\",\"ProfileId\": \"f2fa479b-3224-4d42-83ba-520e7416d6ee\",\"Region\": \"EMEA\",\"SalesSegment\": \"CHN\",\"SessionId\": \"abc\",\"LocalizedCatalogId\": 148,\"PricingTemplateId\": 0,\"IsGlobalPortal\": false,\"IsSiebelEnabledUsFedStore\": false} " | rex field=_raw "Message=Message :(?<json>.*)$" | eval _raw=json | kv | table LightweightProfile.Region LightweightProfile.Country LightweightProfile.CustomerSet ActionArguments.quoteNumber | rename "LightweightProfile.Region" as Region "LightweightProfile.Country" as Country "LightweightProfile.CustomerSet" as CustomerSet "ActionArguments.quoteNumber" as quoteNumber

Thanks

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Maximizing the Value of Splunk ES 8.x

Splunk Enterprise Security (ES) continues to be a leader in the Gartner Magic Quadrant, reflecting its pivotal ...