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

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...