Alerting

Execute .cmd Splunk CLI Script alert with .sh Shell Script File

dscoland
Path Finder

Hi Splunk Community,

I don't want to get technical on this, but I have an alert that I would like to run a .cmd file from when it triggers. This .cmd runs a Splunk CLI script that generates a report which correlates to the alert.

I am assuming that Splunk only recognizes .sh files within the C:\Program Files\Splunk\bin\scripts directory. Therefore, is there an easy way to execute a .cmd file with a .sh script?

Thank you!
Daniel

Tags (5)
0 Karma
1 Solution

lguinn2
Legend

If you are running Splunk on Windows, Splunk will run .bat scripts instead of .sh scripts.

So just write a .bat script that launches whatever you like!

View solution in original post

lguinn2
Legend

If you are running Splunk on Windows, Splunk will run .bat scripts instead of .sh scripts.

So just write a .bat script that launches whatever you like!

lguinn2
Legend

All you should need to do is to put the full path to the script in the right box of the alert actions.

0 Karma

dscoland
Path Finder

I was able to successfully create the .bat file. But Splunk still does not run the script. Do I have to add an additional command to run the .bat file in the script field of the alert?

0 Karma

dscoland
Path Finder

Is this even possible?

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...