All Apps and Add-ons

Water Gauge visualization Drilldown??

rahul_jasrotia
Path Finder

Hi Splunkers,

I just wanted to implement a very simple example but it turned out to be not so simple.

Instead of the single value panel, I wanted to show a Water Gauge visualisation but I can't seem to find a way to put a drilldown with it. I am using a inpage drilldown with a single value which just works fine but unable to find any drilldown setting with the water gauge.

Can someone help me with this?

0 Karma
1 Solution

niketn
Legend

@rahul_jasrotia, Most custom visualizations do not have drilldown event associated with them. So, you will have to write your own JavaScript. You can do this using Javascript extension to simple XML. (Refer to answer from @gwobben https://answers.splunk.com/answers/471329/is-it-possible-to-drilldown-from-an-status-indicat.html).

Following is an example which opens a new URL (answes.splunk.com) on clicking the Water Gauge Custom visualization. You can point to your own dashboard or report if you need.

Step 1: Provide an ID to the panel with Water Gauge in it. I have used waterGauge1 in this example

  <row>
    <panel>
      <viz id="waterGauge1" type="cuviz_water_gauge.water_gauge">

Step 2: Create a JavaScript (water_gauge_drilldown.js in this example) with drilldown, by handling the click event.

var components = [
     "splunkjs/ready!",
     "splunkjs/mvc/simplexml/ready!",
     "jquery"
 ];

 // Require the components
 require(components, function(
     mvc,
     ignored,
     $
 ) {

     $('#waterGauge1').click(function() {
       window.open(
                   'https://answers.splunk.com',
                   '_blank' // <- Open target in a new window.
                 );
     });
 });

Step 3: Load the JavaScript in your Dashboard/Form's root node(depending on what you have).

<dashboard script="water_gauge_drilldown.js">

Or

<form script="water_gauge_drilldown.js">

Step 4: You might need to Restart Splunk and clear your browser history for the JavaScript code to be picked up in your dashboard.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

niketn
Legend

@rahul_jasrotia, Most custom visualizations do not have drilldown event associated with them. So, you will have to write your own JavaScript. You can do this using Javascript extension to simple XML. (Refer to answer from @gwobben https://answers.splunk.com/answers/471329/is-it-possible-to-drilldown-from-an-status-indicat.html).

Following is an example which opens a new URL (answes.splunk.com) on clicking the Water Gauge Custom visualization. You can point to your own dashboard or report if you need.

Step 1: Provide an ID to the panel with Water Gauge in it. I have used waterGauge1 in this example

  <row>
    <panel>
      <viz id="waterGauge1" type="cuviz_water_gauge.water_gauge">

Step 2: Create a JavaScript (water_gauge_drilldown.js in this example) with drilldown, by handling the click event.

var components = [
     "splunkjs/ready!",
     "splunkjs/mvc/simplexml/ready!",
     "jquery"
 ];

 // Require the components
 require(components, function(
     mvc,
     ignored,
     $
 ) {

     $('#waterGauge1').click(function() {
       window.open(
                   'https://answers.splunk.com',
                   '_blank' // <- Open target in a new window.
                 );
     });
 });

Step 3: Load the JavaScript in your Dashboard/Form's root node(depending on what you have).

<dashboard script="water_gauge_drilldown.js">

Or

<form script="water_gauge_drilldown.js">

Step 4: You might need to Restart Splunk and clear your browser history for the JavaScript code to be picked up in your dashboard.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

rahul_jasrotia
Path Finder

Thanks for your reply @harishalipaka but I've already seen the click events. I've tried drilldown=all option as well with it with no luck.

Any other pointers please?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

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

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

Customer success is front and center at .conf25

Hi Splunkers, If you are not able to be at .conf25 in person, you can still learn about all the latest news ...

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...