Dashboards & Visualizations

How to display a popup message "yes/no" to display the results in the dashboard table?

Ashwini008
Builder

@kamlesh_vaghela Thank You

Labels (4)
0 Karma
1 Solution

kamlesh_vaghela
SplunkTrust
SplunkTrust

@Ashwini008 

 <option name="drilldown">cell</option>
        <drilldown>
          <condition field="YOUR_COLUMN_NAME">
            <link target="_blank">PUT_YOUR_LINK</link>
          </condition>
          <condition>
             <!-- Skip Drilldown  Logc-->
          </condition>
        </drilldown>

 

Just confirm above drilldown config  with your code.

Thanks
KV


If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.

View solution in original post

kamlesh_vaghela
SplunkTrust
SplunkTrust

@Ashwini008 

Try below example code and modify as per your requirement.

XML

 

<form script="a.js">
  <label>Submit Button Confirm Alert</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="tkn_A" searchWhenChanged="false">
      <label>Dropdown A</label>
      <choice value="A">A</choice>
      <choice value="AA">AA</choice>
    </input>
    <input type="text" token="tkn_B" searchWhenChanged="false">
      <label>Text B</label>
    </input>
    <html>
      <input type="button" id="submitbutton" class="btn btn-primary" value="Submit"></input>
    </html>
  </fieldset>
  <row>
    <panel>
      <table>
        <title>Test Table</title>
        <search>
          <query>|makeresults count=10 | eval dropdown_a="$tkn_A$", text_b="$tkn_B$"</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
        <option name="refresh.display">progressbar</option>
      </table>
    </panel>
  </row>
</form>

 

a.js

require([
    'underscore',
    'jquery',
    'splunkjs/mvc',
    'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc) {
    console.log("LAZY!!!");
    var defaultTokenModel = mvc.Components.get('default');
    var submittedTokenModel = mvc.Components.get("submitted");
    $(document).ready(function() {
        $('input#submitbutton').click(function() {
            if (confirm("Are you sure?!")) {
                defaultTokenModel.set("dummy", 1);
                submittedTokenModel.set(defaultTokenModel.toJSON());
            } else {
                console.log("Do Nothing")
            }
        });
    });
});

 

Thanks
KV


If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.

 

Ashwini008
Builder

@kamlesh_vaghela Thank you.

When i click on any anywhere in the row it is taking me to the URL link.

Can you please help me only on click of  "129" it should take me to the link?

Ashwini008_1-1650989145643.png

 

 

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@Ashwini008 

 <option name="drilldown">cell</option>
        <drilldown>
          <condition field="YOUR_COLUMN_NAME">
            <link target="_blank">PUT_YOUR_LINK</link>
          </condition>
          <condition>
             <!-- Skip Drilldown  Logc-->
          </condition>
        </drilldown>

 

Just confirm above drilldown config  with your code.

Thanks
KV


If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.

gcusello
SplunkTrust
SplunkTrust

Hi @Ashwini008,

this isn't a standard feature in Splunk dashboards (old Simple XML and new Dashboard Studio).

You could do this using a Javascript but it isn't so easy and not much manageable because you have to move the action od the dashbard to the JS.

But why do you want to do this?

Ciao.

Giuseppe

0 Karma
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!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...