Splunk Enterprise

Run a custom script

syedsaadat
Observer

I came across of running a custom python script in Splunk on the triggered events by adding the run a script action but I don't know how to do it. As the alerts are visible on Splunk I want to run a script and extract those triggered alerts by running a script.

Labels (1)
0 Karma

_JP
Contributor

You can create a Custom Alert Action that is backed by your python script:

Using custom alert actions - Splunk Documentation

And here's the developer details on how you need to set things up:

https://dev.splunk.com/enterprise/docs/devtools/customalertactions/

 

0 Karma

syedsaadat
Observer

I tried implementing slack app but unable to send alerts to splunk so can you guide me through how to use the app to send alerts without using webhook.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Where did you come across this feature?  As I recall, Splunk removed the ability to run a script as an alert action years ago.

---
If this reply helps you, Karma would be appreciated.
0 Karma

syedsaadat
Observer

Yes I came across that thing. So is there a alternative way to run python scripts?

0 Karma

_JP
Contributor

The old way of just running a python script as an alert action was deprecated a while back.  It was a really simple, "run script and here's the search data."  That way is old and busted...so it is not around anymore.

 

The new hotness is Custom Alert Actions.  You can create one that runs your python.  There's some more setup/configuration so it is registered with the system and more effort goes into packaging it up as an official configuration in Splunk (official as in you made it for your environment...).

Here is a previous discussion on this topic, too.

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 ...