Getting Data In

Export CLI Savedsearch report results to CSV Windows 7

whytepaul
New Member

I'm trying to get a straight forward Splunk CLI command to run on my Windows 7 box;

Execute a save search say MySearch and output the results to a CSV.

splunk search "|savedsearch MySearch" -outputcsv test.csv

I would expect the resulting CSV to appear in the C:\Program Files\Splunk\var\run\splunk directory but it doesn't.

The search results are appearing the command window indicating that the CLI command is running.

I have read that there can be some syntax issues running the CLI on a windows box.

What am I missing?

Tags (4)
0 Karma
1 Solution

okrabbe_splunk
Splunk Employee
Splunk Employee

I think you want to just use the windows built in command line redirection.

ie. splunk search "|savedsearch MySearch" -output csv > test.csv

Please note that the output command is specifying the format and not the type of file. That is why you need to redirect the output to a file.

View solution in original post

okrabbe_splunk
Splunk Employee
Splunk Employee

I think you want to just use the windows built in command line redirection.

ie. splunk search "|savedsearch MySearch" -output csv > test.csv

Please note that the output command is specifying the format and not the type of file. That is why you need to redirect the output to a file.

Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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