<?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: How to get alert result through API? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-alert-result-through-API/m-p/709374#M239742</link>
    <description>&lt;P&gt;Thanks for the help&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/49493"&gt;@tscroggins&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;I was able to get the result calling the API. But I had to fill in the {search_id} manually, is there a way to get the {search_id} through the endpoint or I have to retrieve it from a parameter in another GET request.&lt;/P&gt;&lt;P&gt;I need this because it's a daily alert and I would need to get the result through the API endpoint daily as well in BTP IS&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jan 2025 20:51:22 GMT</pubDate>
    <dc:creator>BrianLam</dc:creator>
    <dc:date>2025-01-21T20:51:22Z</dc:date>
    <item>
      <title>How to get alert result through API?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-alert-result-through-API/m-p/709138#M239680</link>
      <description>&lt;P&gt;I'm calling the API from BTP IS and want to get the result of an alert that I created from before. My alert name is&amp;nbsp;PRD - Daily CCS Integrations Error Report, not quite sure what's the correct syntax of the URL and command to get the result.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 23:01:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-alert-result-through-API/m-p/709138#M239680</guid>
      <dc:creator>BrianLam</dc:creator>
      <dc:date>2025-01-17T23:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to get alert result through API?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-alert-result-through-API/m-p/709151#M239682</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/275676"&gt;@BrianLam&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can retrieve the search results using the search/v2/jobs/{search_id}/results endpoint. See&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fv2.2Fjobs.2F.7Bsearch_id.7D.2Fresults" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fv2.2Fjobs.2F.7Bsearch_id.7D.2Fresults&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;The search_id value is specific to the instance of the search that generated the alert.&lt;/P&gt;&lt;P&gt;It's a simple GET request. The default output mode is XML. If you want JSON output, pass the output_mode query parameter as part of the GET request:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;https://splunk:8089/services/search/v2/jobs/scheduler__user__app__xxx_at_xxx_xxx/results?output_mode=json&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jan 2025 23:49:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-alert-result-through-API/m-p/709151#M239682</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2025-01-18T23:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to get alert result through API?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-alert-result-through-API/m-p/709374#M239742</link>
      <description>&lt;P&gt;Thanks for the help&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/49493"&gt;@tscroggins&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;I was able to get the result calling the API. But I had to fill in the {search_id} manually, is there a way to get the {search_id} through the endpoint or I have to retrieve it from a parameter in another GET request.&lt;/P&gt;&lt;P&gt;I need this because it's a daily alert and I would need to get the result through the API endpoint daily as well in BTP IS&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 20:51:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-alert-result-through-API/m-p/709374#M239742</guid>
      <dc:creator>BrianLam</dc:creator>
      <dc:date>2025-01-21T20:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to get alert result through API?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-alert-result-through-API/m-p/709798#M239865</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/275676"&gt;@BrianLam&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I recommend enabling the &lt;STRONG&gt;Add to Triggered Alerts&lt;/STRONG&gt; action and then using the /services/alerts/fired_alerts/{name} endpoint to get the most recent alert:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;https://splunk:8089/servicesNS/-/-/alerts/fired_alerts/foo?output_mode=json&amp;amp;count=1&amp;amp;sort_dir=desc&amp;amp;sort_key=published&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then use the related job link at .entry[0].links.job to construct a results URI:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  /* ... */
  "entry": [
    /* ... */
    "links": {
      /* ... */
      "job": "/servicesNS/admin/search/search/jobs/scheduler__admin__search__xxx_at_xxx_xxx",
      /* ... */
    }
  ],
  /* ... */
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;→&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;https://splunk:8089/servicesNS/admin/search/search/jobs/scheduler__admin__search__xxx_at_xxx_xxx/results?output_mode=json&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example, the search named foo is owned by the admin user in the search app. You can find more information on using namespaces at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/RESTUM/RESTusing#Namespace" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/latest/RESTUM/RESTusing#Namespace&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2025 20:09:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-alert-result-through-API/m-p/709798#M239865</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2025-01-26T20:09:38Z</dc:date>
    </item>
  </channel>
</rss>

