Dashboards & Visualizations

Running a script easily from Menu with input

davedeluxe
Engager

Hi,
I have a python script that requires a hostname as input and then runs an Ansible job via AWX.
Is there a way to install this cleanly via a dashboard or in a menu in ES?
I actually just want to enter the hostname and use it to start the script.

Regards,

David

Labels (1)
0 Karma

VatsalJagani
SplunkTrust
SplunkTrust

@davedeluxe- There is no direct way to run Python script from Splunk dashboard. But you can use one of the two ways below to Run Python script from a dashboard button.

  • Python Custom Command
    • Create Javascript to initiate the Splunk search with this custom command in it.
  • Python Custom Rest Endpoint
    • Create Javascript to make a rest call to the custom rest endpoint created by you.

 

And in both case you can use Javascript to pass whatever data you need to pass-along the way.

And you can put your custom python script within custom python command code or custom rest endpoint code.

And you will find number of examples online for both custom command & custom rest endpoint.

This is one is old blog about custom rest endpoint for reference - https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-call-a-Python-script-from-a-dashboar...

 

I hope this helps!!! Kindly upvote if it does!!!!

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...