Reporting

How do i create a custom python script to get the result and modify them to send mail in splunk

linu1988
Champion

Hello Everyone,
I would like to run a script that customizes the output of a savedsearch and send emails. I am not able to get any reference from where i would start. Could any one help me get any reference or guidance for creating a script how it can be called when a savedseach is being executed? I am able to get the script customized which is provided by splunk, but with that i am able to achieve only one custom script per App.

Any kind of help will be appreciated. Thanks

0 Karma
1 Solution

yannK
Splunk Employee
Splunk Employee

You could use a regular scheduled search with an alert condition. And specify a scripted alert, that will be called if the condition is achieved.
Then you write the script, one of the parameter is the path to the csv file containing the results, you can process them before emailing them.

see http://docs.splunk.com/Documentation/Splunk/latest/Alert/Configuringscriptedalerts

View solution in original post

yannK
Splunk Employee
Splunk Employee

You could use a regular scheduled search with an alert condition. And specify a scripted alert, that will be called if the condition is achieved.
Then you write the script, one of the parameter is the path to the csv file containing the results, you can process them before emailing them.

see http://docs.splunk.com/Documentation/Splunk/latest/Alert/Configuringscriptedalerts

Get Updates on the Splunk Community!

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Cultivate Your Career Growth with Fresh Splunk Training

Growth doesn’t just happen—it’s nurtured. Like tending a garden, developing your Splunk skills takes the right ...

Introducing a Smarter Way to Discover Apps on Splunkbase

We’re excited to announce the launch of a foundational enhancement to Splunkbase: App Tiering.  Because we’ve ...