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
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In November, the Splunk Threat Research Team had one release of new security content via the Enterprise ...

Index This | Divide 100 by half. What do you get?

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

Stay Connected: Your Guide to December Tech Talks, Office Hours, and Webinars!

❄️ Celebrate the season with our December lineup of Community Office Hours, Tech Talks, and Webinars! ...