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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...