Dashboards & Visualizations
Highlighted

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

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

Highlighted

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

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?

Highlighted

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

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.