<?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: REST API: Create Search, Dispatch, Get Status, and Results. How can I run this flow in succession? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/REST-API-Create-Search-Dispatch-Get-Status-and-Results-How-can-I/m-p/206183#M40709</link>
    <description>&lt;P&gt;Got it, thanks! This may be my alternative solution because I'm trying to get the results by SID where this requires the search query. &lt;/P&gt;

&lt;P&gt;I'll have to look into some of the features of Golang and figure out if theres a way to do this.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jan 2016 18:04:14 GMT</pubDate>
    <dc:creator>ks2211</dc:creator>
    <dc:date>2016-01-06T18:04:14Z</dc:date>
    <item>
      <title>REST API: Create Search, Dispatch, Get Status, and Results. How can I run this flow in succession?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/REST-API-Create-Search-Dispatch-Get-Status-and-Results-How-can-I/m-p/206178#M40704</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I am using the Splunk REST API (mainly search, savedsearch endpoints) to get data out of Splunk. &lt;/P&gt;

&lt;P&gt;Currently I am trying to do the following:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Create a saved search&lt;/LI&gt;
&lt;LI&gt;Dispatch said search to get SID&lt;/LI&gt;
&lt;LI&gt;Check status of the job with given SID&lt;/LI&gt;
&lt;LI&gt;Get the results of the job for SID back&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Right now, I have steps 1,2, and 4 working fine.&lt;BR /&gt;
I can run steps 1 and 2 in succession without issues. Step 3 I can run right after 1 and 2, but having issues.&lt;BR /&gt;
Step 3, I can run it, but having issues here because it seems like I need to poll to get the status of the Job--is there a better way to handle this (mainly to check the status of the job)?&lt;BR /&gt;
Step 4, I can run in isolation AFTER i have the SID, but cannot run 1,2,3,4 in succession.&lt;/P&gt;

&lt;P&gt;Any suggestions on fixing step 3? I need to check the status and only continue when it is "DONE" but can't figure out a way to keep checking the status. &lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 19:19:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/REST-API-Create-Search-Dispatch-Get-Status-and-Results-How-can-I/m-p/206178#M40704</guid>
      <dc:creator>ks2211</dc:creator>
      <dc:date>2016-01-05T19:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: REST API: Create Search, Dispatch, Get Status, and Results. How can I run this flow in succession?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/REST-API-Create-Search-Dispatch-Get-Status-and-Results-How-can-I/m-p/206179#M40705</link>
      <description>&lt;P&gt;I can't edit my post for Karma points reasons but I had one correction :&lt;/P&gt;

&lt;P&gt;Step 3, I can run it but having issues here because it seems like I need to poll to get the status of the Job--is there a better way to handle this (mainly to check the status of the job)--I found a workaround where I do a loop and do a check on the job over an interval (in golang's terms, use time.Sleep at this section). Ideally i'd like some sort of trigger that lets this function finish when either "DONE" or "FAILED" is returned from the job status. &lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 19:52:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/REST-API-Create-Search-Dispatch-Get-Status-and-Results-How-can-I/m-p/206179#M40705</guid>
      <dc:creator>ks2211</dc:creator>
      <dc:date>2016-01-05T19:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: REST API: Create Search, Dispatch, Get Status, and Results. How can I run this flow in succession?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/REST-API-Create-Search-Dispatch-Get-Status-and-Results-How-can-I/m-p/206180#M40706</link>
      <description>&lt;P&gt;Save yourself pain and just use export. See: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.2/RESTREF/RESTsearch#search.2Fjobs.2Fexport"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.2/RESTREF/RESTsearch#search.2Fjobs.2Fexport&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Otherwise as you have found you'll have to do it manually, by polling at a specific interval. Use &lt;CODE&gt;while&lt;/CODE&gt; or a recursive &lt;CODE&gt;if&lt;/CODE&gt; statement.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2016 17:33:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/REST-API-Create-Search-Dispatch-Get-Status-and-Results-How-can-I/m-p/206180#M40706</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2016-01-06T17:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: REST API: Create Search, Dispatch, Get Status, and Results. How can I run this flow in succession?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/REST-API-Create-Search-Dispatch-Get-Status-and-Results-How-can-I/m-p/206181#M40707</link>
      <description>&lt;P&gt;Thanks for your reply. Right now, I'm using a pretty hackish method and doing a loop and checking the value&lt;/P&gt;

&lt;P&gt;How exactly does export work? Does it just give back all of the data for a particular search?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2016 17:40:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/REST-API-Create-Search-Dispatch-Get-Status-and-Results-How-can-I/m-p/206181#M40707</guid>
      <dc:creator>ks2211</dc:creator>
      <dc:date>2016-01-06T17:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: REST API: Create Search, Dispatch, Get Status, and Results. How can I run this flow in succession?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/REST-API-Create-Search-Dispatch-Get-Status-and-Results-How-can-I/m-p/206182#M40708</link>
      <description>&lt;P&gt;The results are streamed back to you. Try doing the example curl: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.1511/RESTREF/RESTsearchExamples#search.2Fjobs.2Fexport_GET"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.1511/RESTREF/RESTsearchExamples#search.2Fjobs.2Fexport_GET&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;For slow searches this may tie up your thread until the search is complete, but if you're doing small searches anyway its probably more efficient. &lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2016 17:48:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/REST-API-Create-Search-Dispatch-Get-Status-and-Results-How-can-I/m-p/206182#M40708</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2016-01-06T17:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: REST API: Create Search, Dispatch, Get Status, and Results. How can I run this flow in succession?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/REST-API-Create-Search-Dispatch-Get-Status-and-Results-How-can-I/m-p/206183#M40709</link>
      <description>&lt;P&gt;Got it, thanks! This may be my alternative solution because I'm trying to get the results by SID where this requires the search query. &lt;/P&gt;

&lt;P&gt;I'll have to look into some of the features of Golang and figure out if theres a way to do this.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2016 18:04:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/REST-API-Create-Search-Dispatch-Get-Status-and-Results-How-can-I/m-p/206183#M40709</guid>
      <dc:creator>ks2211</dc:creator>
      <dc:date>2016-01-06T18:04:14Z</dc:date>
    </item>
  </channel>
</rss>

