Other Usage

How to use REST API for Alerts

Travis_Stanley
Observer

Hi,  I'm trying to use the REST API 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? 

GET

Labels (1)
0 Karma

Travis_Stanley
Observer

Specifically listing them  using  the GET is proving troublesome. When I search the returned results, I don't find all alerts, but I do find all reports.

The POST to create and alert is not an issue. 

0 Karma

_JP
Contributor

This is how I have been able to access these things via REST.

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.  By default, Splunk will run alerts you configure, but won't necessarily "track" them unless you explicitly tell it to.  It looks like this in the GUI:

_JP_0-1697041146758.png

Once you add that Alert Action and some alerts fire, you'll see the triggered events in the GUI and via this REST endpoint:

 

/alerts/fired_alerts/

 

 

Once you're getting your list of triggered alerts, then you can find the sid value within the data returned and then use the other REST endpints to fetch stuff for the actual search that was ran.  Here's a screenshot of a bit of the output from the above rest endpoint on my test environment:

_JP_2-1697041373347.png

Also - note that the Expire setting for the alert will control how long Splunk keeps those results around for those sids:

 

_JP_3-1697041476035.png

 

 

 

0 Karma

Travis_Stanley
Observer

Hi @_JP , 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.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...