<?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: Retrieving Search Results via Splunk API in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-retrieve-search-results-via-Splunk-API/m-p/643997#M223103</link>
    <description>&lt;P&gt;To perform a search, you first post it to the search endpoint as a job.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -H "Authorization: Bearer &amp;lt;token&amp;gt;" https://&amp;lt;host&amp;gt;.splunkcloud.com:8089/services/search/job -d search="my great search"&lt;/LI-CODE&gt;&lt;P&gt;This will submit "my great search" and return an XML document. &amp;nbsp;You then use the value of the document's &amp;lt;sid /&amp;gt; segment get the result, like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -H "Authorization: Bearer &amp;lt;token&amp;gt;" --get https://&amp;lt;host&amp;gt;.splunkcloud.com:8089/services/search/job/&amp;lt;sid&amp;gt;/result" -d output_mode=json&lt;/LI-CODE&gt;&lt;P&gt;Of course, you can use output_mode=json in the first command and use the sid node of the JSON document.&lt;/P&gt;</description>
    <pubDate>Sat, 20 May 2023 04:59:43 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2023-05-20T04:59:43Z</dc:date>
    <item>
      <title>How retrieve search results via Splunk API?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-retrieve-search-results-via-Splunk-API/m-p/643979#M223099</link>
      <description>&lt;P&gt;I recently enabled Splunk tokens (using SAML authentication) and am able to successfully execute basic API calls (such as the one below).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl -H "Authorization: Bearer &amp;lt;token&amp;gt;" -X GET https://&amp;lt;host&amp;gt;.splunkcloud.com:8089/services/authorization/roles&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a Splunk search that works great from the Splunk Cloud UI, but I would like to be able to retrieve the same data in either JSON or CSV format.&amp;nbsp; I have attempted to follow the Splunk documentation on this, but being brand new may simply be missing something.&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;What is the best way to achive my goal in this case?&lt;/LI&gt;
&lt;LI&gt;Is using Splunk tokens the preferred/best approach?&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 22 May 2023 13:10:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-retrieve-search-results-via-Splunk-API/m-p/643979#M223099</guid>
      <dc:creator>qcjacobo2577</dc:creator>
      <dc:date>2023-05-22T13:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving Search Results via Splunk API</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-retrieve-search-results-via-Splunk-API/m-p/643997#M223103</link>
      <description>&lt;P&gt;To perform a search, you first post it to the search endpoint as a job.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -H "Authorization: Bearer &amp;lt;token&amp;gt;" https://&amp;lt;host&amp;gt;.splunkcloud.com:8089/services/search/job -d search="my great search"&lt;/LI-CODE&gt;&lt;P&gt;This will submit "my great search" and return an XML document. &amp;nbsp;You then use the value of the document's &amp;lt;sid /&amp;gt; segment get the result, like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -H "Authorization: Bearer &amp;lt;token&amp;gt;" --get https://&amp;lt;host&amp;gt;.splunkcloud.com:8089/services/search/job/&amp;lt;sid&amp;gt;/result" -d output_mode=json&lt;/LI-CODE&gt;&lt;P&gt;Of course, you can use output_mode=json in the first command and use the sid node of the JSON document.&lt;/P&gt;</description>
      <pubDate>Sat, 20 May 2023 04:59:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-retrieve-search-results-via-Splunk-API/m-p/643997#M223103</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-05-20T04:59:43Z</dc:date>
    </item>
  </channel>
</rss>

