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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...