<?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 results from api search in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Exporting-results-from-api-search/m-p/577126#M101940</link>
    <description>&lt;P&gt;Hello, I am trying to export the results from an api search, currently I am using the curl command:&amp;nbsp;&lt;/P&gt;&lt;P&gt;curl -k -u user:pass &lt;A href="https://hostname:8089/services/search/jobs/export?search=$NewQ" target="_blank" rel="noopener"&gt;https://hostname:8089/services/search/jobs/export?search=$NewQ&lt;/A&gt; -o Output-file.csv&lt;/P&gt;&lt;P&gt;I can see that the search completed in the splunk webclient but am not able to find the output csv file that should result from this command. I have checked the $SPLUNK_HOME/var/run/splunk/csv folder after each attempt at using this command and there has never been a file created there (which to my understanding is where this file is supposed to be created). Any help is greatly appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; thank you.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Dec 2021 19:41:37 GMT</pubDate>
    <dc:creator>jmadsen1</dc:creator>
    <dc:date>2021-12-02T19:41:37Z</dc:date>
    <item>
      <title>Exporting results from api search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Exporting-results-from-api-search/m-p/577126#M101940</link>
      <description>&lt;P&gt;Hello, I am trying to export the results from an api search, currently I am using the curl command:&amp;nbsp;&lt;/P&gt;&lt;P&gt;curl -k -u user:pass &lt;A href="https://hostname:8089/services/search/jobs/export?search=$NewQ" target="_blank" rel="noopener"&gt;https://hostname:8089/services/search/jobs/export?search=$NewQ&lt;/A&gt; -o Output-file.csv&lt;/P&gt;&lt;P&gt;I can see that the search completed in the splunk webclient but am not able to find the output csv file that should result from this command. I have checked the $SPLUNK_HOME/var/run/splunk/csv folder after each attempt at using this command and there has never been a file created there (which to my understanding is where this file is supposed to be created). Any help is greatly appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 19:41:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Exporting-results-from-api-search/m-p/577126#M101940</guid>
      <dc:creator>jmadsen1</dc:creator>
      <dc:date>2021-12-02T19:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting results from api search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Exporting-results-from-api-search/m-p/577297#M101972</link>
      <description>&lt;P&gt;Try something like this....&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -k -u user:password https://localhost:8089/servicesNS/admin/search/search/jobs/export -d search="search index=_internal 
| head 3" -d output_mode=csv/xml/json&lt;/LI-CODE&gt;&lt;P&gt;This will store the results in the user path as shown below.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gr0und_Z3r0_0-1638577277787.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17113i73436AE085EDB09D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gr0und_Z3r0_0-1638577277787.png" alt="Gr0und_Z3r0_0-1638577277787.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Dec 2021 00:21:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Exporting-results-from-api-search/m-p/577297#M101972</guid>
      <dc:creator>Gr0und_Z3r0</dc:creator>
      <dc:date>2021-12-04T00:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting results from api search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Exporting-results-from-api-search/m-p/577471#M102003</link>
      <description>&lt;P&gt;Thank you for the response, I have tried several variations on your suggested solution and this curl command still doesn't seems to produce any exported files of any type on my system. Is there anywhere this file could be generated that is not this directory? is there preliminary steps to take to get it to generate at all?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 14:15:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Exporting-results-from-api-search/m-p/577471#M102003</guid>
      <dc:creator>jmadsen1</dc:creator>
      <dc:date>2021-12-06T14:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting results from api search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Exporting-results-from-api-search/m-p/577479#M102006</link>
      <description>&lt;P class="lia-indent-padding-left-30px"&gt;Wait a second. Where are you looking for the results file? On splunk server? If you're calling curl with -o option, you'll get an output file on your local computer - the one calling curl.&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;BTW, calling API this way might not be the best way if the search produces big result set.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 15:23:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Exporting-results-from-api-search/m-p/577479#M102006</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-12-06T15:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting results from api search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Exporting-results-from-api-search/m-p/577485#M102009</link>
      <description>&lt;P&gt;In my testing environment the PC I am executing the Curl command from is the acting splunk server, yet no files are created when I check that file mentioned file path&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 16:18:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Exporting-results-from-api-search/m-p/577485#M102009</guid>
      <dc:creator>jmadsen1</dc:creator>
      <dc:date>2021-12-06T16:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting results from api search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Exporting-results-from-api-search/m-p/577500#M102011</link>
      <description>&lt;P&gt;Of you run the curl command without the -o switch, do you get any results on the terminal?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 17:58:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Exporting-results-from-api-search/m-p/577500#M102011</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-12-06T17:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting results from api search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Exporting-results-from-api-search/m-p/577503#M102012</link>
      <description>&lt;P&gt;Without the -o switch the curl command returns a large set of data for all the results of the search, which is what I am trying to export to the csv file in question that will not generate.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 18:23:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Exporting-results-from-api-search/m-p/577503#M102012</guid>
      <dc:creator>jmadsen1</dc:creator>
      <dc:date>2021-12-06T18:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting results from api search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Exporting-results-from-api-search/m-p/577508#M102013</link>
      <description>&lt;P&gt;The -o switch simply causes curl to write server's output (which is otherwise printed on screen) to a file. So unless you have some local issues, like insufficient permissions in the directory you're calling curl from to write a file ther, there has to be a file created with the output. If you're running this curl from unix/linux box remember that the filenames are case-sensitive, so if you wrote Output.csv and look for outout.csv, you won't find it - these are two different files.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 18:52:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Exporting-results-from-api-search/m-p/577508#M102013</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-12-06T18:52:01Z</dc:date>
    </item>
  </channel>
</rss>

