<?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 Re: Using the REST API in Python to export large search results, why does the search auto finalize? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Using-the-REST-API-in-Python-to-export-large-search-results-why/m-p/191587#M2590</link>
    <description>&lt;P&gt;Thanks @martin_mueller. I will try that out.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jul 2015 16:41:37 GMT</pubDate>
    <dc:creator>karan1337</dc:creator>
    <dc:date>2015-07-07T16:41:37Z</dc:date>
    <item>
      <title>Using the REST API in Python to export large search results, why does the search auto finalize?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Using-the-REST-API-in-Python-to-export-large-search-results-why/m-p/191580#M2583</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to export (Stream) huge search results by using the REST API directly in python. For 1 minute of data, I get about 600,000 events. For 10 minutes I am able to get the data, but when I increase the time for more than 10 minutes, the search auto finalizes. (I see in the Jobs page that my search is not available in the UI, but the dispatch status is "finalizing")&lt;/P&gt;

&lt;P&gt;My export search is something like: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=somename sourcetype=somename earliest=-20m | table _indextime, _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there any setting that restricts even the export api from streaming all results?  &lt;/P&gt;</description>
      <pubDate>Sun, 05 Jul 2015 23:06:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Using-the-REST-API-in-Python-to-export-large-search-results-why/m-p/191580#M2583</guid>
      <dc:creator>karan1337</dc:creator>
      <dc:date>2015-07-05T23:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using the REST API in Python to export large search results, why does the search auto finalize?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Using-the-REST-API-in-Python-to-export-large-search-results-why/m-p/191581#M2584</link>
      <description>&lt;P&gt;For large jobs you'd be better off creating a search "traditionally" by POSTing to &lt;CODE&gt;search/jobs&lt;/CODE&gt; instead of &lt;CODE&gt;search/jobs/export&lt;/CODE&gt;, retrieve the sid, and then load results off that sid. See this snippet from the docs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;If it is too big, you might instead run with the search/jobs (not search/jobs/export) endpoint (it takes POST with the same parameters), maybe using the exec_mode=blocking. You'll then get back a search id, and then you can page through the results and request them from the server under your control, which is a better approach for extremely large result sets that need to be chunked. 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/RESTREF/RESTsearch#search.2Fjobs.2Fexport"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.3/RESTREF/RESTsearch#search.2Fjobs.2Fexport&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jul 2015 23:20:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Using-the-REST-API-in-Python-to-export-large-search-results-why/m-p/191581#M2584</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-07-05T23:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using the REST API in Python to export large search results, why does the search auto finalize?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Using-the-REST-API-in-Python-to-export-large-search-results-why/m-p/191582#M2585</link>
      <description>&lt;P&gt;Here's what the docs recommend on exporting large volumes: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/Search/Exportsearchresults#Python_SDK"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.3/Search/Exportsearchresults#Python_SDK&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jul 2015 23:28:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Using-the-REST-API-in-Python-to-export-large-search-results-why/m-p/191582#M2585</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-07-05T23:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using the REST API in Python to export large search results, why does the search auto finalize?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Using-the-REST-API-in-Python-to-export-large-search-results-why/m-p/191583#M2586</link>
      <description>&lt;P&gt;@martin_mueller I tried this and the only issue was streaming using the SDK is taking a hit on performance in my use case. Export or search directly using the REST API is way faster than using the SDK.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jul 2015 23:37:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Using-the-REST-API-in-Python-to-export-large-search-results-why/m-p/191583#M2586</guid>
      <dc:creator>karan1337</dc:creator>
      <dc:date>2015-07-05T23:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using the REST API in Python to export large search results, why does the search auto finalize?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Using-the-REST-API-in-Python-to-export-large-search-results-why/m-p/191584#M2587</link>
      <description>&lt;P&gt;@martin_mueller I also tried POSTing to /search/jobs. For a large set of results (more than 10 million), this endpoint is not giving me more than 500,009 results ( i don't know the reason for this number). When i append | table * to my query, i do get all results but the result took more than 1 hour to stream back to my remote system from the splunk machine. Such a long time might not be practical for my use case.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2015 05:15:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Using-the-REST-API-in-Python-to-export-large-search-results-why/m-p/191584#M2587</guid>
      <dc:creator>karan1337</dc:creator>
      <dc:date>2015-07-06T05:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using the REST API in Python to export large search results, why does the search auto finalize?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Using-the-REST-API-in-Python-to-export-large-search-results-why/m-p/191585#M2588</link>
      <description>&lt;P&gt;&lt;CODE&gt;| table *&lt;/CODE&gt; is a terrible idea because it tells Splunk to extract ALL the fields. Consider &lt;CODE&gt;| table _raw&lt;/CODE&gt; instead if that's all you're looking to export.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2015 16:49:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Using-the-REST-API-in-Python-to-export-large-search-results-why/m-p/191585#M2588</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-07-06T16:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using the REST API in Python to export large search results, why does the search auto finalize?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Using-the-REST-API-in-Python-to-export-large-search-results-why/m-p/191586#M2589</link>
      <description>&lt;P&gt;You may get &lt;EM&gt;much&lt;/EM&gt; better speeds if you set &lt;CODE&gt;output_mode=raw&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$ curl -k -u admin:changeme &lt;A href="https://localhost:8089/services/search/jobs/export" target="test_blank"&gt;https://localhost:8089/services/search/jobs/export&lt;/A&gt; -d search="search index=_internal" -d output_mode=raw &amp;gt; outfile
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  686M    0  686M    0    45  13.1M      0 --:--:--  0:00:52 --:--:-- 12.0M
$ cat outfile | wc -l
4007497
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Four million events, 700MB, 52 seconds, run on my home all-in-one Splunk instance.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2015 17:18:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Using-the-REST-API-in-Python-to-export-large-search-results-why/m-p/191586#M2589</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-07-06T17:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using the REST API in Python to export large search results, why does the search auto finalize?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Using-the-REST-API-in-Python-to-export-large-search-results-why/m-p/191587#M2590</link>
      <description>&lt;P&gt;Thanks @martin_mueller. I will try that out.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2015 16:41:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Using-the-REST-API-in-Python-to-export-large-search-results-why/m-p/191587#M2590</guid>
      <dc:creator>karan1337</dc:creator>
      <dc:date>2015-07-07T16:41:37Z</dc:date>
    </item>
  </channel>
</rss>

