Getting Data In
Highlighted

How to output a file in CSV format with maxresultrows in it, using curl?

New Member

I'm trying to output a file in CSV format with maxresultrows in it, using curl.

It works the way I want:

$(curl -s -u user:pass -k https://localhost:8089/services/search/jobs/$id/results/?count=0 --get -d output_mode=csv > ${file})

However, now I want a larger number of rows, so I add: maxresultrows=500000
But it outputs in xml instead of csv, event with output_mode=csv:

$(curl -s -u user:pass -k https://localhost:8089/services/search/jobs/$id/results/?count=0 --get -d maxresultrows=500000 
 output_mode=csv > ${file})

What am I missing here?

EDIT: One thing that I found was that without "maxresultrows" and "outputmode=csv", it outputs all result rows but in XML, it seems that the bottleneck is the outputmode, can't find why it just doesn't outputs all the result rows in CSV file.

Please help!

0 Karma
Speak Up for Splunk Careers!

We want to better understand the impact Splunk experience and expertise has has on individuals' careers, and help highlight the growing demand for Splunk skills.