Alerting

Is it possible to pass additional parameters to an alert script?

robertlabrie
Path Finder

So this has been asked, and I've googled it hard, but I can't seem to find a concise answer. Can I pass additional parameters to an alert script? Say for arguments sake, I have dosomethingawesome.py, and I want to re-use it for different alerts, and maybe I want to pass in a -server parameter or a -awesomelevel parameter into dosomethingawesome.py, can I do that? Of course I tried and it looks like no, I just want to know for sure: is it impossible?

Thanks,
Rob

0 Karma

stephanefotso
Motivator

Hello! I don't know if i have understood very well your problem . But i think,

If you just want to pass in a -server parameter or a -awesomelevel parameter into dosomethingawesome.py, Just write annother script, let say setparameter.py, which can take your server parameters and pass it into dosomethingawesome.py. And then create your alert that run setparameter.py as an action. When the alert triggered, your parametters will be sent to dosomethingawesome.py by setparameter.py.

Thanks.
please let me know if i got you.

SGF
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...