<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Running a script easily from Menu with input in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Running-a-script-easily-from-Menu-with-input/m-p/710269#M58100</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253369"&gt;@davedeluxe&lt;/a&gt;- 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.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Python Custom Command&lt;UL&gt;&lt;LI&gt;Create Javascript to initiate the Splunk search with this custom command in it.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Python Custom Rest Endpoint&lt;UL&gt;&lt;LI&gt;Create Javascript to make a rest call to the custom rest endpoint created by you.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And in both case you can use Javascript to pass whatever data you need to pass-along the way.&lt;/P&gt;&lt;P&gt;And you can put your custom python script within custom python command code or custom rest endpoint code.&lt;/P&gt;&lt;P&gt;And you will find number of examples online for both custom command &amp;amp; custom rest endpoint.&lt;/P&gt;&lt;P&gt;This is one is old blog about custom rest endpoint for reference - &lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-call-a-Python-script-from-a-dashboard-and-output-its/m-p/398088" target="_blank"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-call-a-Python-script-from-a-dashboard-and-output-its/m-p/398088&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!!! Kindly upvote if it does!!!!&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jan 2025 12:59:43 GMT</pubDate>
    <dc:creator>VatsalJagani</dc:creator>
    <dc:date>2025-01-30T12:59:43Z</dc:date>
    <item>
      <title>Running a script easily from Menu with input</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Running-a-script-easily-from-Menu-with-input/m-p/705803#M57821</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I have a python script that requires a hostname as input and then runs an Ansible job via AWX.&lt;BR /&gt;Is there a way to install this cleanly via a dashboard or in a menu in ES?&lt;BR /&gt;I actually just want to enter the hostname and use it to start the script.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 11:53:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Running-a-script-easily-from-Menu-with-input/m-p/705803#M57821</guid>
      <dc:creator>davedeluxe</dc:creator>
      <dc:date>2024-12-03T11:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Running a script easily from Menu with input</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Running-a-script-easily-from-Menu-with-input/m-p/710269#M58100</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253369"&gt;@davedeluxe&lt;/a&gt;- 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.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Python Custom Command&lt;UL&gt;&lt;LI&gt;Create Javascript to initiate the Splunk search with this custom command in it.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Python Custom Rest Endpoint&lt;UL&gt;&lt;LI&gt;Create Javascript to make a rest call to the custom rest endpoint created by you.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And in both case you can use Javascript to pass whatever data you need to pass-along the way.&lt;/P&gt;&lt;P&gt;And you can put your custom python script within custom python command code or custom rest endpoint code.&lt;/P&gt;&lt;P&gt;And you will find number of examples online for both custom command &amp;amp; custom rest endpoint.&lt;/P&gt;&lt;P&gt;This is one is old blog about custom rest endpoint for reference - &lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-call-a-Python-script-from-a-dashboard-and-output-its/m-p/398088" target="_blank"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-call-a-Python-script-from-a-dashboard-and-output-its/m-p/398088&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!!! Kindly upvote if it does!!!!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 12:59:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Running-a-script-easily-from-Menu-with-input/m-p/710269#M58100</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2025-01-30T12:59:43Z</dc:date>
    </item>
  </channel>
</rss>

