Is it possible to drilldown to a specific panel on a dashboard. ?
how to do it ?
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
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>
@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.
Precisely what I was looking for but with an option to set token value. @sylim_splunk please share if you found anything
Thanks Kamlesh, ill try this and get back to you
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.
Hi @jiaqya,
I think niketnilay's answer will help you. Can you please check link?
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...
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.
Hi @nabeel652 - Do you have a sample code to get that to work please?
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...
Hi @jiaqya - looking for something similar, did you get it to work?