Dashboards & Visualizations

How to set the Timepicker in a dashboard from the drilldown of a timechart?

thisissplunk
Builder

Is there an easy way to pass the time range obtained from clicking on a bar in a timechart to the timepicker? I want all of my panels on the dashboard to reflect the timerange chosen by the timechart. They all use the timepicker so I figured this would be the easiest way to achieve this.

0 Karma
1 Solution

niketn
Legend

You can code Chart's drilldown event to populate selection earliest and latest values (if not it selects the search earliest and latest values).

  <drilldown>
    <set token="tok_earliest">$earliest$</set>
    <set token="tok_latest">$latest$</set>
  </drilldown>

PS: Your timechart should not be using global timepicker 🙂

Refer to http://docs.splunk.com/Documentation/Splunk/latest/Viz/Understandbasictableandchartdrilldownactions
and http://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML#Drilldown_even...

Also, check out selection chart event handler, where you can select a timerange in timechart and drill down will pick earliest and latest from the selection. http://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML#Drilldown_even...

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

View solution in original post

cmerriman
Super Champion

set the tokens using start and end
http://docs.splunk.com/Documentation/Splunk/latest/Viz/tokens#Define_tokens_for_pan_and_zoom_chart_c...

<selection>
    <set token="selection_earliest">$start$</set>
    <set token="selection_latest">$end$</set>
</selection>

thisissplunk
Builder

Thanks. niketnilay got to it a minute before you did.

0 Karma

niketn
Legend

You can code Chart's drilldown event to populate selection earliest and latest values (if not it selects the search earliest and latest values).

  <drilldown>
    <set token="tok_earliest">$earliest$</set>
    <set token="tok_latest">$latest$</set>
  </drilldown>

PS: Your timechart should not be using global timepicker 🙂

Refer to http://docs.splunk.com/Documentation/Splunk/latest/Viz/Understandbasictableandchartdrilldownactions
and http://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML#Drilldown_even...

Also, check out selection chart event handler, where you can select a timerange in timechart and drill down will pick earliest and latest from the selection. http://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML#Drilldown_even...

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

thisissplunk
Builder

Ok, so this grabs the time values, but how do I actually use it if I'm already using time.earliest and time.latest in my other panels? Is there a way to say "use this time instead now that you've clicked the timechart"?

0 Karma

cmerriman
Super Champion

in your other panels, use <earliest>$tok_earliest$</earliest>

0 Karma

thisissplunk
Builder

I need to use the global timepicker for my other panels as they all depend on that for a time range in the same way the timechart panel does. There's really no difference between them. If I use tok_earliest on all of my other panels, when I update my global timepicker, those won't get updated.

What I really want to do is update the global timepicker via the timechart. Any ideas?

Edit: A crappy solution I found was to reset time.earliest and time.latest via the timechart. This works, but kind of breaks the timepicker as it stops updating your dashboard when you try to use it after clicking the timechart: <set token="time.earliest">$earliest$</set>

0 Karma

niketn
Legend

@thisissplunk... You should not correlate global time picker and timechart earliest and latest time. You can use a timepicker for timechart with defaults set. If you are using 6.5 you can keep the time picker hidden unless required to override the timechart.
Then like I had mentioned, timechart should be providing you with your earliest and latest values. If you do not click on timechart the earliest and latest will be from your global time picker.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...