<?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 use REST API for Alerts in Other Usage</title>
    <link>https://community.splunk.com/t5/Other-Usage/How-to-use-REST-API-for-Alerts/m-p/660495#M933</link>
    <description>&lt;P&gt;Specifically listing them&amp;nbsp; using&amp;nbsp; the GET is proving troublesome. When I search the returned results, I don't find all alerts, but I do find all reports.&lt;BR /&gt;&lt;BR /&gt;The POST to create and alert is not an issue.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Oct 2023 09:58:14 GMT</pubDate>
    <dc:creator>Travis_Stanley</dc:creator>
    <dc:date>2023-10-12T09:58:14Z</dc:date>
    <item>
      <title>How to use REST API for Alerts</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-use-REST-API-for-Alerts/m-p/660408#M930</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&amp;nbsp;I'm trying to use the &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch?_gl=1*4ukxuy*_ga*Nzk2MDA5NDY1LjE2NjY5NTY1Nzk.*_ga_GS7YF8S63Y*MTY5NzAyODg5My4xNy4xLjE2OTcwMzA0NDUuNjAuMC4w*_ga_5EPM2P39FV*MTY5NzAyODYyOC44Ny4xLjE2OTcwMzA0NDYuMC4wLjA.&amp;amp;_ga=2.13146295.1495734924.1696846027-796009465.1666956579&amp;amp;_gac=1.22483273.1696928057.Cj0KCQjw7JOpBhCfARIsAL3bobcC8urxbsx-khXJ51Nv1q21bCxfOzEbs68RELFh2YnA7Niml813N7EaArdnEALw_wcB#saved.2Fsearches" target="_self"&gt;REST API&lt;/A&gt;&amp;nbsp;to get and post saved searches that are Alerts but for some reason it only returns data for Reports. Has anyone else had this problem?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;GET&lt;/P&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;A target="_blank" rel="noopener"&gt;https://&amp;lt;host&amp;gt;:&amp;lt;mPort&amp;gt;/services/saved/searches&lt;/A&gt;&lt;/PRE&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;A target="_blank" rel="noopener"&gt;https://&amp;lt;host&amp;gt;:&amp;lt;mPort&amp;gt;/services/saved/searches/{name}&lt;/A&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 11 Oct 2023 15:35:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-use-REST-API-for-Alerts/m-p/660408#M930</guid>
      <dc:creator>Travis_Stanley</dc:creator>
      <dc:date>2023-10-11T15:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to use REST API for Alerts</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-use-REST-API-for-Alerts/m-p/660417#M931</link>
      <description>&lt;P&gt;This is how I have been able to access these things via REST.&lt;/P&gt;&lt;P&gt;The first thing you need to make sure is you have the "Add to Triggered Alerts" Alert Action that you want to be see these in the GUI or REST.&amp;nbsp; By default, Splunk will run alerts you configure, but won't necessarily "track" them unless you explicitly tell it to.&amp;nbsp; It looks like this in the GUI:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="_JP_0-1697041146758.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27539i1792C4DEC2EB1A4D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="_JP_0-1697041146758.png" alt="_JP_0-1697041146758.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Once you add that Alert Action and some alerts fire, you'll see the triggered events in the GUI and via&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#alerts.2Ffired_alerts" target="_self"&gt; this REST endpoint&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/alerts/fired_alerts/&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once you're getting your list of triggered alerts, then you can find the&amp;nbsp;&lt;EM&gt;sid&lt;/EM&gt; value within the data returned and then use the other REST endpints to fetch stuff for the actual search that was ran.&amp;nbsp; Here's a screenshot of a bit of the output from the above rest endpoint on my test environment:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="_JP_2-1697041373347.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27541iE7125D64CB57FA4B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="_JP_2-1697041373347.png" alt="_JP_2-1697041373347.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Also - note that the Expire setting for the alert will control how long Splunk keeps those results around for those sids:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="_JP_3-1697041476035.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27542i5F4F68457EB732E7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="_JP_3-1697041476035.png" alt="_JP_3-1697041476035.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 16:47:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-use-REST-API-for-Alerts/m-p/660417#M931</guid>
      <dc:creator>_JP</dc:creator>
      <dc:date>2023-10-11T16:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to use REST API for Alerts</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-use-REST-API-for-Alerts/m-p/660486#M932</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/261258"&gt;@_JP&lt;/a&gt;&amp;nbsp;, Thanks for the reply but that's not what I'm looking for. I want the ability to list and create alerts, not view triggered alerts.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 07:44:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-use-REST-API-for-Alerts/m-p/660486#M932</guid>
      <dc:creator>Travis_Stanley</dc:creator>
      <dc:date>2023-10-12T07:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to use REST API for Alerts</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-use-REST-API-for-Alerts/m-p/660495#M933</link>
      <description>&lt;P&gt;Specifically listing them&amp;nbsp; using&amp;nbsp; the GET is proving troublesome. When I search the returned results, I don't find all alerts, but I do find all reports.&lt;BR /&gt;&lt;BR /&gt;The POST to create and alert is not an issue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 09:58:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-use-REST-API-for-Alerts/m-p/660495#M933</guid>
      <dc:creator>Travis_Stanley</dc:creator>
      <dc:date>2023-10-12T09:58:14Z</dc:date>
    </item>
  </channel>
</rss>

