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.
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...
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>
Thanks. niketnilay got to it a minute before you did.
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...
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"?
in your other panels, use <earliest>$tok_earliest$</earliest>
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>
@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.