<?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: Report vs Alert in REST API for saved searches in Other Usage</title>
    <link>https://community.splunk.com/t5/Other-Usage/Report-vs-Alert-in-REST-API-for-saved-searches/m-p/369659#M1273</link>
    <description>&lt;P&gt;I used this to determine if the saved search was a report or an alert:&lt;BR /&gt;
&lt;CODE&gt;| eval ss_type=if((NOT 'action'=="*" AND NOT alert_track=="*" AND NOT alert_condition=="*" AND 'alert_type'=="always"),"report","alert")&lt;/CODE&gt;&lt;BR /&gt;
 it may just be when 'alert_type'=="always" but I added the others to be safe. I needed to do this to create clickable links that would open the report or alert .   So you might want to check if it has these values, which would cause it to be recognized as a report.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jan 2018 22:18:42 GMT</pubDate>
    <dc:creator>AVOLLMER</dc:creator>
    <dc:date>2018-01-30T22:18:42Z</dc:date>
    <item>
      <title>Report vs Alert in REST API for saved searches</title>
      <link>https://community.splunk.com/t5/Other-Usage/Report-vs-Alert-in-REST-API-for-saved-searches/m-p/369658#M1272</link>
      <description>&lt;P&gt;I queried the /servicesNS/-/-/saved/searches GET API and got a number of responses which included saved searches listed under Reports and Alerts on the front end. I took the response for one of the alerts, extracted the relevant information (without changing any values) and did a POST to /servicesNS/{owner}/{app}/saved/searches/{name}. After I did the POST, the saved search is now showing up under Report on the UI.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2018 15:23:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Report-vs-Alert-in-REST-API-for-saved-searches/m-p/369658#M1272</guid>
      <dc:creator>catchaj88</dc:creator>
      <dc:date>2018-01-02T15:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: Report vs Alert in REST API for saved searches</title>
      <link>https://community.splunk.com/t5/Other-Usage/Report-vs-Alert-in-REST-API-for-saved-searches/m-p/369659#M1273</link>
      <description>&lt;P&gt;I used this to determine if the saved search was a report or an alert:&lt;BR /&gt;
&lt;CODE&gt;| eval ss_type=if((NOT 'action'=="*" AND NOT alert_track=="*" AND NOT alert_condition=="*" AND 'alert_type'=="always"),"report","alert")&lt;/CODE&gt;&lt;BR /&gt;
 it may just be when 'alert_type'=="always" but I added the others to be safe. I needed to do this to create clickable links that would open the report or alert .   So you might want to check if it has these values, which would cause it to be recognized as a report.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 22:18:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Report-vs-Alert-in-REST-API-for-saved-searches/m-p/369659#M1273</guid>
      <dc:creator>AVOLLMER</dc:creator>
      <dc:date>2018-01-30T22:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Report vs Alert in REST API for saved searches</title>
      <link>https://community.splunk.com/t5/Other-Usage/Report-vs-Alert-in-REST-API-for-saved-searches/m-p/369660#M1274</link>
      <description>&lt;P&gt;It's an old thread, but is &lt;CODE&gt;alert_type=="always"&lt;/CODE&gt; enough to determine that a saved search is an alert?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 16:51:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Report-vs-Alert-in-REST-API-for-saved-searches/m-p/369660#M1274</guid>
      <dc:creator>danielbb</dc:creator>
      <dc:date>2019-11-20T16:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Report vs Alert in REST API for saved searches</title>
      <link>https://community.splunk.com/t5/Other-Usage/Report-vs-Alert-in-REST-API-for-saved-searches/m-p/369661#M1275</link>
      <description>&lt;P&gt;Apparently, it's the other way around - &lt;CODE&gt;alert_type == "always"&lt;/CODE&gt;, means that the saved search is a report, because it always fires and therefore to detect alerts we need to use &lt;CODE&gt;alert_type != "always"&lt;/CODE&gt;, in cases when &lt;CODE&gt;alert_type == "number of events"&lt;/CODE&gt; etc.  &lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 18:07:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Report-vs-Alert-in-REST-API-for-saved-searches/m-p/369661#M1275</guid>
      <dc:creator>danielbb</dc:creator>
      <dc:date>2019-11-20T18:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Report vs Alert in REST API for saved searches</title>
      <link>https://community.splunk.com/t5/Other-Usage/Report-vs-Alert-in-REST-API-for-saved-searches/m-p/576778#M1276</link>
      <description>&lt;P&gt;The thread is even older now, but I also found you need to specify&amp;nbsp; `&lt;SPAN&gt;'alert.suppress'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;` when posting to `&lt;SPAN&gt;/servicesNS/{owner}/{app}/saved/searches/&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;` to make sure it's an alert and not a report.&lt;BR /&gt;In total, I specified at least the below parameters to create an alert&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
    'is_scheduled': 1,
    'cron_schedule': '09-59/10 * * * *',
    'alert_comparator': 'greater than',
    'alert_threshold': 5,
    'alert_type': 'number of events',
    'alert.suppress': 0,
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 16:57:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Report-vs-Alert-in-REST-API-for-saved-searches/m-p/576778#M1276</guid>
      <dc:creator>emottola</dc:creator>
      <dc:date>2021-11-30T16:57:34Z</dc:date>
    </item>
  </channel>
</rss>

