Dashboards & Visualizations

Drilldown to a specific panel on another dashboard.

jiaqya
Builder

Is it possible to drilldown to a specific panel on a dashboard. ?
how to do it ?

Tags (1)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

Hi @jiaqya,

Well, I'm able to do it with Javascript.

Can you please try below example?

mytest.js

require([
     'underscore',
     'jquery',
     'splunkjs/mvc',
     'splunkjs/mvc/simplexml/ready!'
 ], function(_, $, mvc) {

$(document).ready(function () {
    var loadTarget = location.hash.replace('#','');
    var offset = 0;

    offset = $("#"+loadTarget).offset().top;

    $('html, body').animate({
        scrollTop: offset
    }, 550);
});
});

I have set id to my panel.

test_dashboard.xml

<dashboard script="mytest.js">
  <label>Test Dashboard</label>
  <row>
    <panel>
      <chart>
        <search>
          <query>index=_internal  | stats count as AA by sourcetype</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="charting.chart">pie</option>
        <option name="charting.drilldown">all</option>
      </chart>
    </panel>
  </row>
  <row>
    <panel>
      <chart>
        <search>
          <query>index=_internal  | stats count as AA by sourcetype</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="charting.chart">pie</option>
        <option name="charting.drilldown">all</option>
      </chart>
    </panel>
  </row>
  <row>
    <panel>
      <chart>
        <search>
          <query>index=_internal  | stats count as AA by sourcetype</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="charting.chart">pie</option>
        <option name="charting.drilldown">all</option>
      </chart>
    </panel>
  </row>
  <row>
    <panel>
      <chart>
        <search>
          <query>index=_internal  | stats count as AA by sourcetype</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="charting.chart">pie</option>
        <option name="charting.drilldown">all</option>
      </chart>
    </panel>
  </row>
  <row>
    <panel>
      <chart>
        <search>
          <query>index=_internal  | stats count as AA by sourcetype</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="charting.chart">pie</option>
        <option name="charting.drilldown">all</option>
      </chart>
    </panel>
  </row>
  <row>
    <panel id="mypanel">
      <title>Total ABC-1 Errors Last 4 Hours</title>
      <single>
        <search>
          <query>sourcetype=foo errorCode=1 OR errorCode=ABC-1 | stats dc(ip)</query>
        </search>
      </single>
    </panel>
  </row>
</dashboard>

On Drilldown code, pass your panel Id after #.
eg

http://SPLUNK_SERVER/en-GB/app/MY_APP/test_dashboard#mypanel

Well, I hope this will help you.

Thanks

sylim_splunk
Splunk Employee
Splunk Employee

Thank you this is awesome!
This one works well without any params passed to the next dashboard.
Could you think of another method that would work for, like,

i.e)

      <link target="_blank">/app/splunk_health_monitoring/forwarder_test?name=$click.name$&value=$click.value$&panel=jumptoHere</link>
0 Karma

sinvin
Engager

@sylim_splunk  Did you found a solution? I am in the exact same issue as you reported. I am wondering if you found a way to pass params and the panel name to the drilldown.

0 Karma

gaurav_arya
Observer

Precisely what I was looking for but with an option to set token value. @sylim_splunk please share if you found anything

0 Karma

jiaqya
Builder

Thanks Kamlesh, ill try this and get back to you

0 Karma

jiaqya
Builder

i didnt have to try above solution, our team decided to convert the panel into a new dashboard. so its easy now to redirect via drill down..

thanks everyone for the responses.

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

Hi @jiaqya,

I think niketnilay's answer will help you. Can you please check link?

https://answers.splunk.com/answers/614375/how-to-drill-down-from-dashboard-to-filtered-repor.html#co...

0 Karma

jiaqya
Builder

Kamlesh, thanks for response, but this does not help me. What i am trying to do is , when i click a link on another dashbaord, its configured with drilldown to an url., which is again another dashboard. But the panel i want to go to is at the bottom of the dashboard. so i wanted to know if i can have a drill down which can directly take me to the panel ( ie bottom of the page )

i have been using form tokens for passing values to the next dashboard. but i dont know how to go to the specific panel...

0 Karma

nabeel652
Builder

So you want to auto scroll to the panel on same dashboard. I think you'll have to use html for that by bookmarking the panel and applying token at the same time.

0 Karma

rahul_jasrotia
Path Finder

Hi @nabeel652 - Do you have a sample code to get that to work please?

0 Karma

jiaqya
Builder

Yes you are right, i want to directly scroll to that panel. do you have an example link of how i can do that. currently the page is not html...

0 Karma

rahul_jasrotia
Path Finder

Hi @jiaqya - looking for something similar, did you get it to work?

0 Karma

jiaqya
Builder

No Sir, we decided to use a dashboard instead of panel... thats it...

Tags (1)
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...