Dashboards & Visualizations

How to trigger a backend script via Splunk UI submit button?

koshyk
Super Champion

We have a requirement to trigger a script based on a submit button (eg from the Splunk UI examples, our end-user requires a shell script to be run). Is it easy to do or require SDK's etc? (I feel its more like an ajax request to trigger a server-side script)

Can we do differently/quickly via Splunk UI to trigger a backend script from the UI element?

Added more details as per feedback
- Customer wants to trigger backend script(s) with values fetched from a Splunk UI form i.e. user captured values. The form will collect user input and the submit button should pass the values to a backend script (same as a normal ajax call request to server-side script)
- The backend script is a shell script which will run certain actions like loading up a control-m job or something.
- The backend script exists in a standalone SH
- The backend script currently exists of itself, but we can put into an app/bin if required

dwaddle
SplunkTrust
SplunkTrust

Vague question is slightly vague. But, there are some ways you can do it.

  1. The ... | script search command. http://docs.splunk.com/Documentation/Splunk/6.5.2/SearchReference/script
  2. A custom search command. http://dev.splunk.com/view/python-sdk/SP-CAAAEU2
  3. A custom REST API endpoint that runs your script

I think more information is needed to be able to provide more useful advice.

rjthibod
Champion

Can you share some more details?

Does it need to be the Submit button on top of the dashboard or elsewhere on the dashboard?

Where is the script running? Is it on the search head or some other remote server? Is the script installed as part of a Splunk app or something else?

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...