Getting Data In

Delete fired-alerts via endpoint?

rroberts
Splunk Employee
Splunk Employee

I can list fired-alerts via endpoint https://localhost:8089/servicesNS/admin/search/alerts/fired_alerts/-
There is a way to delete fired-alerts via API?

Tags (2)
1 Solution

rroberts
Splunk Employee
Splunk Employee

Found snippet example using Python internal SDK:

Fired_alert.py

Provides object mapping for fired alerts objects

Example use case:

sessionKey = splunk.auth.getSessionKey('admin','changeme')

s = SavedSearch.get('/servicesNS/admin/search/admin/savedsearch/someAlert')
alerts = s.get_alerts()

# print them all
for a in alerts:

print a.severity, str(a.trigger_time), str(action)

#now delete the most recent one

alerts[0].delete()

View solution in original post

mzorzi
Splunk Employee
Splunk Employee

rroberts
Splunk Employee
Splunk Employee

Found snippet example using Python internal SDK:

Fired_alert.py

Provides object mapping for fired alerts objects

Example use case:

sessionKey = splunk.auth.getSessionKey('admin','changeme')

s = SavedSearch.get('/servicesNS/admin/search/admin/savedsearch/someAlert')
alerts = s.get_alerts()

# print them all
for a in alerts:

print a.severity, str(a.trigger_time), str(action)

#now delete the most recent one

alerts[0].delete()

sbsbb
Builder

Hi Robert, could you post your entire code here ?

0 Karma
Get Updates on the Splunk Community!

Monitoring Postgres with OpenTelemetry

Behind every business-critical application, you’ll find databases. These behind-the-scenes stores power ...

Mastering Synthetic Browser Testing: Pro Tips to Keep Your Web App Running Smoothly

To start, if you're new to synthetic monitoring, I recommend exploring this synthetic monitoring overview. In ...

Splunk Edge Processor | Popular Use Cases to Get Started with Edge Processor

Splunk Edge Processor offers more efficient, flexible data transformation – helping you reduce noise, control ...