Splunk Search

How to write a search to extract these field values from my sample data without mismatch and export to CSV?

sathishsathiyam
New Member

Below is my applogs data:

{"name":"blink-api-manager","submodule":"perfLogger","level":30,"req":{"url":"/api/accounts/transfers/retrieveAccounts","method":"GET","uuid":"ciqki748r0ur3tvmx6nlh7k3s"},"APIResponseTime":{"AccountsView.findByCustomerId":{"api":892.391628}},"OverallResponseTime":894.698927,"msg":"","time":"2016-07-13T06:26:24.069Z","v":0} 

I have more than 20K data and need to filter 4 values: URL - APIResponseTime - OverallResponseTime - Time orderwise and need to download it in a CSV format. How it can be done?

0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Run following search and export result as csv

Your base search | rename req.* as * | table url APIResponseTime OVerallResponseTime time 

See this for export method
http://docs.splunk.com/Documentation/Splunk/6.4.1/Search/Exportsearchresults#Export_data_using_Splun...

View solution in original post

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Run following search and export result as csv

Your base search | rename req.* as * | table url APIResponseTime OVerallResponseTime time 

See this for export method
http://docs.splunk.com/Documentation/Splunk/6.4.1/Search/Exportsearchresults#Export_data_using_Splun...

0 Karma

sathishsathiyam
New Member

Thanks for the info, it just worked with table command itself.

0 Karma

sundareshr
Legend

May need spath before rename?

0 Karma

somesoni2
SplunkTrust
SplunkTrust

The data looks like a valid JSON , if the sourcetype is configured correctly then the JSON should be parsed correctly with fields already available. But you're correct if that's not the case. Sathish to confirm how his logs are setup/looking in Splunk.

0 Karma

sathishsathiyam
New Member

Yes its a valid JSON and since fields were already available, splunk parsed it correctly

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...