Splunk Enterprise

Build data from index

thirumalreddyb
Communicator

Hi,

I have an interesting question put by my client. Here in this case splunk listens to a port and starts indexing the streaming data. Now that an index is built and there is no physical storage of files(Source), the other tools want to access the physical files. How do I build physical files AUTOMATICALLY from the index.

Note : I tried exporting the results of a search MANUALLY and that worked fine irrespective of the file size. Please correct me for the size factor.

Thanks in advance.

Tags (2)
0 Karma
1 Solution

somesoni2
Revered Legend

Alternatively, if you looking for some script automation for the same, you can use curl command to execute and export the search result (preferred for large no of rows). This command is availabe in Linux/Unix and downloadable versions available for windows.

curl -k -u adminUserName:password https://<<yourHostName:8089/services/search/jobs/export --data-urlencode search='search <<your base search>> | table index,host,source,sourcetype,_raw' -d output_mode=csv -d earliest_time='-2d@d' -d latest_time='-1d@d' -o <<yourfilename>>.csv

View solution in original post

somesoni2
Revered Legend

Alternatively, if you looking for some script automation for the same, you can use curl command to execute and export the search result (preferred for large no of rows). This command is availabe in Linux/Unix and downloadable versions available for windows.

curl -k -u adminUserName:password https://<<yourHostName:8089/services/search/jobs/export --data-urlencode search='search <<your base search>> | table index,host,source,sourcetype,_raw' -d output_mode=csv -d earliest_time='-2d@d' -d latest_time='-1d@d' -o <<yourfilename>>.csv

thirumalreddyb
Communicator

Thank you. I was exactly looking for something like this.

0 Karma

lukejadamec
Super Champion

You could create a search that ends with

| table _time,_raw | outputcsv csvfilename

This will create a csv file in the splunk\var\run\splunk directory that includes the raw data.

http://docs.splunk.com/Documentation/Splunk/6.0/SearchReference/Outputcsv

thirumalreddyb
Communicator

Thanks for your time. I really appreciate.

0 Karma
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...