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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...