<?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 not returning alerts in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Rest-API-not-returning-alerts/m-p/156224#M2555</link>
    <description>&lt;P&gt;Is it a namespace issue?&lt;/P&gt;

&lt;P&gt;Try here&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/146985/how-to-view-list-of-email-addresses-for-saved-alerts.html"&gt;https://answers.splunk.com/answers/146985/how-to-view-list-of-email-addresses-for-saved-alerts.html&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;You need to use namespace wildcards to get all the searches (run as admin), I've added a filter to only load searches that have the email action enabled:
 | rest /servicesNS/-/-/saved/searches search="action.email=1" | table title eai:acl.app eai:acl.owner disabled is_scheduled cron_schedule action.email*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also found these pages helpful&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.2/RESTAPI/RESTsearch"&gt;http://docs.splunk.com/Documentation/Splunk/6.0.2/RESTAPI/RESTsearch&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/RESTREF/RESTsearchExamples"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.2/RESTREF/RESTsearchExamples&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Mar 2015 08:20:37 GMT</pubDate>
    <dc:creator>jackscratch</dc:creator>
    <dc:date>2015-03-26T08:20:37Z</dc:date>
    <item>
      <title>Rest API not returning alerts</title>
      <link>https://community.splunk.com/t5/Alerting/Rest-API-not-returning-alerts/m-p/156221#M2552</link>
      <description>&lt;P&gt;I am using the REST API to create a bot to search for triggered alerts every 30 seconds or so. I created saved searches as alerts on my personal splunk account from my company and everything worked fine. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -k -u [username]:[password] https://[host]/servicesNS/[username]/[app]/alerts/fired_alerts -d "output_mode=json" --get
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I recently got a new splunk account specifically for the bot to use so I went and recreated the alerts I had previously created on the new account but when I run the API calls I am not getting any triggered alerts returned. I can see my test alerts in the alert manager and the alerts I created on the new account are exactly the same as the ones I had on my personal account. &lt;/P&gt;

&lt;P&gt;I have tried deleting the saved searches on my personal account as well as recreating the searches on the bot account but I am unable to see the triggered alerts when I check for them using the API.&lt;/P&gt;

&lt;P&gt;Any help would greatly appreciated.&lt;/P&gt;

&lt;P&gt;edit: If I search for triggered alerts from all apps I am able to see other alerts that were created by other people but not the ones I created.&lt;/P&gt;

&lt;P&gt;I can see the alerts that were triggered &lt;A href="http://i.imgur.com/NcoDyy7.png"&gt;http://i.imgur.com/NcoDyy7.png&lt;/A&gt; but when I run the command I only get &lt;A href="http://pastebin.com/6N9r82k1"&gt;http://pastebin.com/6N9r82k1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jul 2014 15:35:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Rest-API-not-returning-alerts/m-p/156221#M2552</guid>
      <dc:creator>skuller</dc:creator>
      <dc:date>2014-07-24T15:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API not returning alerts</title>
      <link>https://community.splunk.com/t5/Alerting/Rest-API-not-returning-alerts/m-p/156222#M2553</link>
      <description>&lt;P&gt;Hmmm this worked for me:    &lt;/P&gt;

&lt;P&gt;curl --get -ku admin:xxxxx  &lt;A href="https://localhost:9621/servicesNS/admin/sales/alerts/fired_alerts"&gt;https://localhost:9621/servicesNS/admin/sales/alerts/fired_alerts&lt;/A&gt; -d "output_mode=json" &lt;/P&gt;

&lt;P&gt;Try --get upfront.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jul 2014 15:51:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Rest-API-not-returning-alerts/m-p/156222#M2553</guid>
      <dc:creator>rroberts</dc:creator>
      <dc:date>2014-07-24T15:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API not returning alerts</title>
      <link>https://community.splunk.com/t5/Alerting/Rest-API-not-returning-alerts/m-p/156223#M2554</link>
      <description>&lt;P&gt;I get the same results when I run both commands&lt;BR /&gt;
&lt;A href="http://pastebin.com/6N9r82k1"&gt;http://pastebin.com/6N9r82k1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;It says no alerts have been fired but when I go to the alert manager I see &lt;A href="http://i.imgur.com/NcoDyy7.png"&gt;http://i.imgur.com/NcoDyy7.png&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jul 2014 16:00:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Rest-API-not-returning-alerts/m-p/156223#M2554</guid>
      <dc:creator>skuller</dc:creator>
      <dc:date>2014-07-24T16:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API not returning alerts</title>
      <link>https://community.splunk.com/t5/Alerting/Rest-API-not-returning-alerts/m-p/156224#M2555</link>
      <description>&lt;P&gt;Is it a namespace issue?&lt;/P&gt;

&lt;P&gt;Try here&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/146985/how-to-view-list-of-email-addresses-for-saved-alerts.html"&gt;https://answers.splunk.com/answers/146985/how-to-view-list-of-email-addresses-for-saved-alerts.html&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;You need to use namespace wildcards to get all the searches (run as admin), I've added a filter to only load searches that have the email action enabled:
 | rest /servicesNS/-/-/saved/searches search="action.email=1" | table title eai:acl.app eai:acl.owner disabled is_scheduled cron_schedule action.email*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also found these pages helpful&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.2/RESTAPI/RESTsearch"&gt;http://docs.splunk.com/Documentation/Splunk/6.0.2/RESTAPI/RESTsearch&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/RESTREF/RESTsearchExamples"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.2/RESTREF/RESTsearchExamples&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 08:20:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Rest-API-not-returning-alerts/m-p/156224#M2555</guid>
      <dc:creator>jackscratch</dc:creator>
      <dc:date>2015-03-26T08:20:37Z</dc:date>
    </item>
  </channel>
</rss>

