I know I can get the fired alerts from the API on the endpoint:
alerts/fired_alerts
alerts/ also returns the fired alerts. I'd like to know if its possible to get returned a list of all saved alerts. I can't see this in the documentation. But it would be very handy for me to auto generate some monitoring.
try like this:
|rest /services/alerts/fired_alerts
or
|rest /servicesNS/admin/search/alerts/fired_alerts/-
As you may see from the answers suggested so far, alerts are in fact saved searches which have an alert enabled. So instead of looking for alerts in the REST docs, look at saved search endpoints and that's where your answer will lie.
Please try this
rest /servicesNS/-/ApplicationName/saved/searches
This does get a list of all the reports, but the alerts are not included in this list.
try this.. this lists saved searched /reports from all apps
rest /servicesNS/-/-/saved/searches
Yours may be stored in some other app
I was doing that already, I can see all reports, but not any alerts
Hello! Try a search like this:
index=_internal sourcetype=scheduler thread_id=AlertNotifier* NOT (alert_actions="summary_index" OR alert_actions="")|table run_time alert_actions app status
Youa can add more fields as you need in your table
Thanks
Nothing is coming up for this , in fact nothing is under the index=_internal. All my alerts are saved under the search app, but I can't find a way to access them from a search.
Just test this and let me know what happen: index=_internal sourcetype=scheduler thread_id=AlertNotifier*|table run_time alert_actions app status
Hi Thanks, - this does give me a list of alerts and their status. I might be able to work with something based on this if the API does not directly give an alerts endpoint.
Yes... it gives you just the required data .. Just filter and customize it 🙂