Splunk Search

Export search to directory in csv

pmelchiori
Explorer

Hi, I need to export using CLI the Splunk search results. I've created a Windows Custom Search, now I want to export only these results in my csv, how can I do that?

./splunk search "search_name" -maxresults 10000 -format csv > path\file.csv

Why this doesn't work??

Tags (4)
0 Karma
1 Solution

bwooden
Splunk Employee
Splunk Employee

It is true that the free version does not support scheduled searches.

If you would like to generate CSV from a command line. You may want to investigate the outputcsv command.

View solution in original post

0 Karma

bwooden
Splunk Employee
Splunk Employee

It is true that the free version does not support scheduled searches.

If you would like to generate CSV from a command line. You may want to investigate the outputcsv command.

0 Karma

pmelchiori
Explorer

Ok, sorry, I need to schedule an export. The only way that I found with the free license is to schedule a command CLI. So I try to export my customized search. I try:

./splunk search "| savedsearch search_name" -format csv > C:\path\file.csv

I want to know if there are a syntax mistake here, or some other way to schedule an export... thanks

0 Karma

gkanapathy
Splunk Employee
Splunk Employee

please be more clear about what you expect it to do, and what it in fact is doing.

0 Karma
Get Updates on the Splunk Community!

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

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...