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!

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to Officially Supported Splunk ...