<?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: How to create Javascript for a button on a splunk dashboard? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-Javascript-for-a-button-on-a-splunk-dashboard/m-p/628309#M51517</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;, will try to implement the suggested approach.&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jan 2023 16:48:29 GMT</pubDate>
    <dc:creator>Roy_9</dc:creator>
    <dc:date>2023-01-25T16:48:29Z</dc:date>
    <item>
      <title>How to create Javascript for a button on a splunk dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-Javascript-for-a-button-on-a-splunk-dashboard/m-p/627631#M51435</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Can someone please kindly help me with the Javascript for the below criteria.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;create a JavaScript that calls&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;PagerDuty using a button, eventually passing parameters from the dashboard.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 19:01:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-Javascript-for-a-button-on-a-splunk-dashboard/m-p/627631#M51435</guid>
      <dc:creator>Roy_9</dc:creator>
      <dc:date>2023-01-19T19:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to create Javascript for a button on a splunk dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-Javascript-for-a-button-on-a-splunk-dashboard/m-p/627815#M51466</link>
      <description>&lt;P&gt;Did anyone has developed a java script for this similar kind of situation? any leads would be highly appreciated&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 19:04:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-Javascript-for-a-button-on-a-splunk-dashboard/m-p/627815#M51466</guid>
      <dc:creator>Roy_9</dc:creator>
      <dc:date>2023-01-20T19:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to create Javascript for a button on a splunk dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-Javascript-for-a-button-on-a-splunk-dashboard/m-p/627869#M51473</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/224632"&gt;@Roy_9&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's follow the best practice for calling third-party API from Splunk Dashboard.&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create Custom Splunk API which will trigger PagerDuty API&amp;nbsp;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Pass appropriate PagerDuty access tokens&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Refer: &lt;/SPAN&gt;&lt;A href="https://hurricanelabs.com/splunk-tutorials/splunk-custom-endpoints-part-1-the-basics/" target="_blank" rel="noopener"&gt;https://hurricanelabs.com/splunk-tutorials/splunk-custom-endpoints-part-1-the-basics/&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Create JavaScript function and trigger on Button on Click&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Refer: &lt;A href="https://community.splunk.com/t5/Building-for-the-Splunk-Platform/How-to-call-custom-rest-api-with-SplunkJS-SDK-in-app/m-p/592317" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Building-for-the-Splunk-Platform/How-to-call-custom-rest-api-with-SplunkJS-SDK-in-app/m-p/592317&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please check below pictorial view for Flow understanding.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-01-21 at 1.37.54 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/23484iD374BD9A2EFD1EF4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-01-21 at 1.37.54 PM.png" alt="Screenshot 2023-01-21 at 1.37.54 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I hope this will help you.&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;If any of my replies help you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jan 2023 08:10:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-Javascript-for-a-button-on-a-splunk-dashboard/m-p/627869#M51473</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2023-01-21T08:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to create Javascript for a button on a splunk dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-Javascript-for-a-button-on-a-splunk-dashboard/m-p/628309#M51517</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;, will try to implement the suggested approach.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 16:48:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-Javascript-for-a-button-on-a-splunk-dashboard/m-p/628309#M51517</guid>
      <dc:creator>Roy_9</dc:creator>
      <dc:date>2023-01-25T16:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to create Javascript for a button on a splunk dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-Javascript-for-a-button-on-a-splunk-dashboard/m-p/638297#M52207</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/224632"&gt;@Roy_9&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May be it's late but answering.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function callCustomAPI() {
        var service = mvc.createService({ owner: "nobody" });
        //send data to server
        console.log(selected_values_array.join());
        var params = selected_values_array.join();
        service.request("/services/my-api-path","POST", {}, {}, JSON.stringify(params), {'Content-Type': 'application/json'}, function(err, resp) {
            // Handle response    
            if(resp != null){
              if(resp.status == 200){  
                //do something
              } else {
                //do something with status !=200
              }
            }
            // Handle error
            if(err != null){
              //handle error
            }
          });
     }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can call&amp;nbsp;&lt;STRONG&gt;callCustomAPI &lt;/STRONG&gt;from the button click event or any other javascript event.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;If any of my replies help you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 06:04:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-Javascript-for-a-button-on-a-splunk-dashboard/m-p/638297#M52207</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2023-04-03T06:04:43Z</dc:date>
    </item>
  </channel>
</rss>

