Unable to export results in CSV format and raw events which are around 6000+ results, only with particular Search format as below:
index=* 123.123.123.*, for all time
The search was completed and has returned 1,895 results by scanning 2,438,922 events in 2,604.945 seconds
Tried increasing the timeout value on SH in web.conf as below:
splunkdConnectionTimeout = 180
Also added the below parameters on the Search head under /local/web.conf and then restarted the instance but still the issue was present.
server.socket_timeout = 600export_timeout = 600
After applying the above changes, tried to export the results for the same search and the export process wait for some time then seems to timeout and gives socket time out error as below:
Unrecoverable error in the server. Traceback (most recent call last): File "/opt/splunk/lib/python3.7/site-packages/cherrypy/_cpwsgi.py", line 184, in trap return func(*args, **kwargs) File "/opt/splunk/lib/python3.7/site-packages/cherrypy/_cpwsgi.py", line 277, in __next__ return next(self.iter_response) File "/opt/splunk/lib/python3.7/site-packages/cherrypy/lib/encoding.py", line 99, in encoder for chunk in body: File "/opt/splunk/lib/python3.7/site-packages/splunk/rest/__init__.py", line 704, in readall data = response.read(blocksize) File "/opt/splunk/lib/python3.7/http/client.py", line 465, in read n = self.readinto(b) File "/opt/splunk/lib/python3.7/http/client.py", line 509, in readinto n = self.fp.readinto(b) File "/opt/splunk/lib/python3.7/socket.py", line 589, in readinto return self._sock.recv_into(b) File "/opt/splunk/lib/python3.7/ssl.py", line 1071, in recv_into return self.read(nbytes, buffer) File "/opt/splunk/lib/python3.7/ssl.py", line 929, in read return self._sslobj.read(len, buffer) socket.timeout: The read operation timed out
The download operation waits over more than an hour whereas the browser just stays in the waiting loop. Then gets a connection fail error.
It seems to be a super sparse search with 5000+ events over ALL index ALL time. The problem with this particular search nature returns small amount of results (below 10,000 events) over large number of events over all time.
Tried exporting results to RAW event but it gets failed with same problem.
Using the REST API method to export where a user can call the Splunk REST API to export search results. The REST API can be leveraged to execute searches or to perform ad-hoc searches. Data can be exported in JSON, CSV, or XML formats. The Splunk REST API can be used to export data from any Splunk environment, including on-premise.
Exporting data through WebGUI or REST API are alternatives used in different use cases, in spare search when WebGUI export doesn't work using REST API will resolve the issue. Follow the below steps to export the results using REST API:
1. Run a search job using a POST to /services/search/jobs/.
curl -k -u admin:changeme \
https://localhost:8089/services/search/jobs/ -d search="search sourcetype=access_* earliest=-7d"
2. Get the search job ID (SID) for the search. The /jobs endpoint returns an XML response including the <sid>
<?xml version='1.0' encoding='UTF-8'?> <response> <sid>1423855196.339</sid> </response>
3. Use a GET request on the /results endpoint to export the results:
curl -u admin:changeme \
-k https://localhost:8089/servicesNS/admin/search/search/jobs/1423855196.339/results/ \
--get -d output_mode=csv -d count=5
- Incase backend is not accessible, then the below steps to be followed to download the CSV file manually from Web GUI:
1.Use the below query to make csv file :
<add the search query> | outputcsv myfile.csv
- The command will saves the *.csv file under $SPLUNK_HOME/var/run/splunk
2. Access this .csv file from GUI by running "inputlookup" command
inputlookup myfile.csv
3. Then download the file to export it.
Export search results - Splunk Documentation
| Revision | Publish Date | Comments |
|---|---|---|
1.0 |
29-Sep-2026
|
Initial Release |