Dashboards & Visualizations

Panel tag not working

karthikp1989
Explorer

Hi,

I am trying to use tags in a dashboard, with a plan of adding time pickers separately in each of the panels at a later point of time. I am aware this is a very basic xml (there are similar examples in the Splunk examples app as well) but I cant see whats wrong when I use just the same code. The dashboard turns up just blank and doesn't display anything at all. Can someone please help?

Thank you!

 1. <form>
2.  <label>Time Range Picker Within Panels</label>
3.  <description>Example of placing a time range picker within a panel.</description>
4.  <row>
5.  <panel>
6.  <input type="time" token="time_range1">
7.  <label>Time Range for Internal All</label>
8.  <default>
9.  <earliestTime>-60m@m</earliestTime>
10. <latestTime>now</latestTime>
11. </default>
12. </input>
13. <chart>
14. <title>_Internal All</title>
15. <searchString>index=_internal | timechart count by sourcetype</searchString>
16. <earliestTime>$time_range1.earliest$</earliestTime>
17. <latestTime>$time_range1.latest$</latestTime>
18. <option name="charting.chart">line</option>
19. <option name="charting.chart.nullValueMode">gaps</option>
20. <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
21. <option name="charting.chart.stackMode">default</option>
22. <option name="charting.chart.style">shiny</option>
23. <option name="charting.drilldown">all</option>
24. <option name="charting.layout.splitSeries">0</option>
25. <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
26. <option name="charting.legend.placement">right</option>
27. </chart>
28. </panel>
29. <panel>
30. <input type="time" token="time_range2" searchWhenChanged="true">
31. <label>Time Range for Internal Top 25</label>
32. <default>
33. <earliestTime>@d</earliestTime>
34. <latestTime>now</latestTime>
35. </default>
36. </input>
37. <event>
38. <title>_Internal Top 3</title>
39. <searchString>index=_internal | head 3</searchString>
40. <earliestTime>$time_range2.earliest$</earliestTime>
41. <latestTime>$time_range2.latest$</latestTime>
42. <option name="maxLines">5</option>
43. <option name="raw.drilldown">full</option>
44. <option name="rowNumbers">0</option>
45. <option name="type">list</option>
46. <option name="count">5</option>
47. </event>
48. </panel>
49. </row>
50. </form>
Tags (2)
0 Karma

somesoni2
Revered Legend

Sample could be like this (multiple timeRange Picker)

<form script="timerange_panels.js" stylesheet="timerange_panels.css">
  <label>Multiple Time Picker</label>
  <fieldset>
    <input type="time" token="time1">
      <label>TimePicker for SourceType</label>
      <default>
        <earliestTime>-15m</earliestTime>
        <latestTime>now</latestTime>
      </default>
    </input>
    <input type="time" token="time2">
      <label>TimePicker for Source</label>
      <default>
        <earliestTime>-60m@m</earliestTime>
        <latestTime>now</latestTime>
      </default>
    </input>
  </fieldset>
  <row>
    <table>
      <title>Sourcetypes</title>
      <searchString>index=_internal | timechart count by sourcetype</searchString>
      <earliestTime>$time1.earliest$</earliestTime>
      <latestTime>$time1.latest$</latestTime>
      <option name="count">5</option>
      <option name="displayRowNumbers">0</option>
      <option name="wrap">true</option>
      <option name="rowNumbers">false</option>
      <option name="dataOverlayMode">none</option>
      <option name="drilldown">cell</option>
    </table>
    <table>
      <title>Sources</title>
      <searchString>index=_internal | timechart count by source</searchString>
      <earliestTime>$time2.earliest$</earliestTime>
      <latestTime>$time2.latest$</latestTime>
      <option name="count">5</option>
      <option name="displayRowNumbers">0</option>
    </table>
  </row>
</form>

somesoni2
Revered Legend

I am not aware of the javascript to do the same. I would suggest to consider upgrading to 6.1 or above if possible.

0 Karma

karthikp1989
Explorer

I understood the tokens part, but do I have to change anything in JavaScript to add the time pickers to the panels?
Thanks for your time and help! I really appreciate it

0 Karma

somesoni2
Revered Legend

The tag is available only from v 6.1 onwards (and so as the ability to add input controls within charts/table panels). The only workaround I could see is the have all the different timepicker (set as different token) at one place (top of the form) with proper label to identify which panel they belong and then use corresponding tokens at the chart/tables.

karthikp1989
Explorer

My Splunk version is 6.0.3
Is the tag not available in 6.0.3 version? If not, whats the alternative?

Please find my code updated in the question

0 Karma

somesoni2
Revered Legend

Can you post your dashboard xml? Also, ensure that you're creating forms (

) as you want to have use input controls (assuming you're on 6.1 or above)

0 Karma