Dashboards & Visualizations

Passing selected time range to drilldown in Simple XML

IgorB
Path Finder

Hi.

How can I pass the time range selected in timerange picker to a drilldown form in Splunk 6.x Simple XML-based form ?
I've tried passing $earliest$ and $latest$ as described in Simple XML Reference) , but that passes only the time range of the timechart bin I've clicked on.

Form example:

<form>
    <label>Timechart for drilldown</label>
    <fieldset autoRun="true" submitButton="false">
    <input type="time" searchWhenChanged="true">
      <default>
        <earliestTime>-7d@h</earliestTime>
        <latestTime>now</latestTime>
      </default>
    </input>
    </fieldset>
    <row>
    <chart>
      <searchString>index=_internal source=*metrics.log group=per_sourcetype_thruput | timechart sum(kb) AS "KB" by series</searchString>
      <earliestTime>$earliest$</earliestTime>
      <latestTime>$latest$</latestTime>
      <option name="charting.chart">column</option>
      <option name="charting.chart.nullValueMode">gaps</option>
      <option name="charting.drilldown">all</option>
      <drilldown target="new">
        <link>
          <![CDATA[/app/search/test_drilldown?earliest=$earliest$&latest=$latest$]]>
        </link>
      </drilldown>
    </chart>
    </row>
</form>
Tags (2)
1 Solution

somesoni2
Revered Legend

Try this:
Changes - defined token for timerangepicker and used it along with token name where it was/has to be referenced.

<form>
    <label>Timechart for drilldown</label>
    <fieldset autoRun="true" submitButton="false">
    <input type="time" searchWhenChanged="true" token="dashboardTime">
      <default>
        <earliestTime>-7d@h</earliestTime>
        <latestTime>now</latestTime>
      </default>
    </input>
    </fieldset>
    <row>
    <chart>
      <searchString>index=_internal source=*metrics.log group=per_sourcetype_thruput | timechart sum(kb) AS "KB" by series</searchString>
      <earliestTime>$dashboardTime.earliest$</earliestTime>
      <latestTime>$dashboardTime.latest$</latestTime>
      <option name="charting.chart">column</option>
      <option name="charting.chart.nullValueMode">gaps</option>
      <option name="charting.drilldown">all</option>
      <drilldown target="new">
        <link>
          <![CDATA[/app/search/test_drilldown?earliest=$dashboardTime.earliest$&latest=$dashboardTime.latest$]]>
        </link>
      </drilldown>
    </chart>
    </row>
</form>

View solution in original post

somesoni2
Revered Legend

Try this:
Changes - defined token for timerangepicker and used it along with token name where it was/has to be referenced.

<form>
    <label>Timechart for drilldown</label>
    <fieldset autoRun="true" submitButton="false">
    <input type="time" searchWhenChanged="true" token="dashboardTime">
      <default>
        <earliestTime>-7d@h</earliestTime>
        <latestTime>now</latestTime>
      </default>
    </input>
    </fieldset>
    <row>
    <chart>
      <searchString>index=_internal source=*metrics.log group=per_sourcetype_thruput | timechart sum(kb) AS "KB" by series</searchString>
      <earliestTime>$dashboardTime.earliest$</earliestTime>
      <latestTime>$dashboardTime.latest$</latestTime>
      <option name="charting.chart">column</option>
      <option name="charting.chart.nullValueMode">gaps</option>
      <option name="charting.drilldown">all</option>
      <drilldown target="new">
        <link>
          <![CDATA[/app/search/test_drilldown?earliest=$dashboardTime.earliest$&latest=$dashboardTime.latest$]]>
        </link>
      </drilldown>
    </chart>
    </row>
</form>

zd00191
Communicator

Is it possible to pass an input token and the time range picker time?

0 Karma
Get Updates on the Splunk Community!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...