Alerting

Scripts for Alert Actions

nawazns5038
Builder

Hi,

Can I please get an example of a script to make use of the alerts results.
I have read the documentation that the "$SPLUNK_ARG_8" has the location that holds the results in a zip file .
I want to know how can I access the zip file or open it and use the results by a python or a shell script.

0 Karma

yannK
Splunk Employee
Splunk Employee

Example with scripted alert
https://docs.splunk.com/Documentation/SplunkCloud/latest/Alert/Configuringscriptedalerts
The idea behind the argument to the result zip file, is to use verify the presence of the file, then unzip, read the results (sometimes in csv). then trigger actions. As the scripts runs as the splunk user, it should be able to access the file.
Also splunk ships with python so you can use this language.

Otherwise nowadays, the supported method is to use custom alert actions

http://docs.splunk.com/Documentation/SplunkCloud/latest/Alert/CreateCustomAlerts

0 Karma

nawazns5038
Builder

Yes I could see the link,
Could you please paste some example scripts that are in use or that can be used.

nawazns5038
Builder

Can we use python scripts other than shell scripts for alert actions ?

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