Dashboards & Visualizations

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

Ashwini008
Contributor

@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
Contributor

@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
Legend

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
Get Updates on the Splunk Community!

Improve Your Security Posture

Watch NowImprove Your Security PostureCustomers are at the center of everything we do at Splunk and security ...

Maximize the Value from Microsoft Defender with Splunk

 Watch NowJoin Splunk and Sens Consulting for this Security Edition Tech TalkWho should attend:  Security ...

This Week's Community Digest - Splunk Community Happenings [6.27.22]

Get the latest news and updates from the Splunk Community here! News From Splunk Answers ✍️ Splunk Answers is ...