Splunk Dev

Filter saved searches for Alerts

tmontney
Builder

Using the API, I cannot tell the difference between reports and alerts. How do I distinguish? A parameter in my request? A property returned in the response?

https://mysplunkserver.local:8089/servicesNS/-/-/saved/searches?count=0

Labels (1)
0 Karma

twesty
Path Finder

You should be able to use the alert_condition field for for this.

Check out the link here for more info on the endpoint 🙂

0 Karma

tmontney
Builder

What values are acceptable for alert_condition? It's blank for all my saved searches. I think this is "Trigger Conditions" where it's set to Custom. I don't have that in any of my alerts.

0 Karma

twesty
Path Finder

I'd take a look at your REST results and see which fields in action.* are the safest to work with for you. Unfortunately there isnt a field which states THIS IS AN ALERT. There really should be given the UI has such a clear separation between Alerts and Reports and the architecture behind the scenes stores the config in the same place... but that's another conversation for another time 😀

0 Karma

tmontney
Builder

For email, action.email.subject.alert works. Seems like it's only available for alerts. For other alert actions, nothing I can find that distinguishes them.

twesty
Path Finder

that would work. Just bear in mind that only relying on that one field as your condition will fail if you create an alert which does not send an email

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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