<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Exporting search to csv contains headers, exporting with cURL/API does not in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Exporting-search-to-csv-contains-headers-exporting-with-cURL-API/m-p/20598#M3016</link>
    <description>&lt;P&gt;Is there any way to add headers to the csv output I retrieve from curl? I'm getting them in the gui, but I can't figure out how to get these included through the api.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Apr 2013 17:31:33 GMT</pubDate>
    <dc:creator>sanorthrup</dc:creator>
    <dc:date>2013-04-30T17:31:33Z</dc:date>
    <item>
      <title>Exporting search to csv contains headers, exporting with cURL/API does not</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Exporting-search-to-csv-contains-headers-exporting-with-cURL-API/m-p/20598#M3016</link>
      <description>&lt;P&gt;Is there any way to add headers to the csv output I retrieve from curl? I'm getting them in the gui, but I can't figure out how to get these included through the api.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2013 17:31:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Exporting-search-to-csv-contains-headers-exporting-with-cURL-API/m-p/20598#M3016</guid>
      <dc:creator>sanorthrup</dc:creator>
      <dc:date>2013-04-30T17:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting search to csv contains headers, exporting with cURL/API does not</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Exporting-search-to-csv-contains-headers-exporting-with-cURL-API/m-p/20599#M3017</link>
      <description>&lt;P&gt;Can you post your curl request?&lt;/P&gt;

&lt;P&gt;This works for me:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl  -k -u admin:changeme  -d 'search="search *   |  head 10"' -d "output_mode=csv" &lt;A href="https://localhost:8089/servicesNS/admin/search/search/jobs/export" target="test_blank"&gt;https://localhost:8089/servicesNS/admin/search/search/jobs/export&lt;/A&gt;

"_serial","_time",source,sourcetype,host,index,"splunk_server","_raw"
0,"2013-04-30 19:59:04.105 BST","/opt/apache/log/sl_access_combined.log","sl_access_combined","example.splunk.com","example","splunk.example.com","1.2.3.4 - - [30/Apr/2013 18:59:04:105] ""POST /url HTTP 1.1"" 503 878 ""http://example.com/referer"" ""Googlebot/2.1 ( &lt;A href="http://www.googlebot.com/bot.html)" target="test_blank"&gt;http://www.googlebot.com/bot.html)&lt;/A&gt; "" 623"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Apr 2013 19:01:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Exporting-search-to-csv-contains-headers-exporting-with-cURL-API/m-p/20599#M3017</guid>
      <dc:creator>dart</dc:creator>
      <dc:date>2013-04-30T19:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting search to csv contains headers, exporting with cURL/API does not</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Exporting-search-to-csv-contains-headers-exporting-with-cURL-API/m-p/20600#M3018</link>
      <description>&lt;P&gt;Ok, it looks like you're actually getting the same thing as me. All of your raw data is in quotes, so it shows up as one huge field. When doing an export through the gui it strips the quotes and parses the headers to each field, then includes them in the csv.&lt;BR /&gt;
My query is this:&lt;BR /&gt;
curl -k -u user:pass -d "output_mode=csv" -d "search=| savedsearch sslvpn1d | head 10" -d earliest_time="-1d@d" -d latest_time="-0d@d" &lt;A href="https://splunkserver:8089/services/search/jobs/export" target="_blank"&gt;https://splunkserver:8089/services/search/jobs/export&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Is there some way to have Splunk parse out the interesting fields thru the API the same way that it does thru the GUI?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:48:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Exporting-search-to-csv-contains-headers-exporting-with-cURL-API/m-p/20600#M3018</guid>
      <dc:creator>sanorthrup</dc:creator>
      <dc:date>2020-09-28T13:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting search to csv contains headers, exporting with cURL/API does not</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Exporting-search-to-csv-contains-headers-exporting-with-cURL-API/m-p/20601#M3019</link>
      <description>&lt;P&gt;One way to do this is to run this search:&lt;BR /&gt;
search * | table *| head 10&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2013 19:25:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Exporting-search-to-csv-contains-headers-exporting-with-cURL-API/m-p/20601#M3019</guid>
      <dc:creator>dart</dc:creator>
      <dc:date>2013-04-30T19:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting search to csv contains headers, exporting with cURL/API does not</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Exporting-search-to-csv-contains-headers-exporting-with-cURL-API/m-p/20602#M3020</link>
      <description>&lt;P&gt;table * is what I was missing. Thank you so much.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2013 19:46:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Exporting-search-to-csv-contains-headers-exporting-with-cURL-API/m-p/20602#M3020</guid>
      <dc:creator>sanorthrup</dc:creator>
      <dc:date>2013-04-30T19:46:17Z</dc:date>
    </item>
  </channel>
</rss>

