Reporting

Can search results be exported using a command in the search script/bar?

myli12
Path Finder

Search results can be exported by clicking on the export link above the search results. Does splunk provide a command/function that can be used in the search bar that pipes search results to a file and the file name can be specified?

Tags (1)
1 Solution

yannK
Splunk Employee
Splunk Employee

yes, check mysearch | outputcsv myfile.csv
the file will be written in $SPLUNK_HOME/var/run/splunk folder

see
http://docs.splunk.com/Documentation/Splunk/4.3/SearchReference/Outputcsv

View solution in original post

yannK
Splunk Employee
Splunk Employee

yes, check mysearch | outputcsv myfile.csv
the file will be written in $SPLUNK_HOME/var/run/splunk folder

see
http://docs.splunk.com/Documentation/Splunk/4.3/SearchReference/Outputcsv

yannK
Splunk Employee
Splunk Employee

no, this is the default location.

Another option is to use the command line search and pipe the result to a file in any folder you are.
example :

/opt/splunk/bin/splunk search "mysearch" -output /myfolder/myfile.csv

see http://docs.splunk.com/Documentation/Splunk/4.3/SearchReference/CLIsearchsyntax

myli12
Path Finder

Thanks, yannK. Can you specify the directory you want the result file save to?

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...