All Apps and Add-ons

Splunk Dashboard - timerange token doesn't work in dbxquery command

cheriemilk
Path Finder

Hi Team,

I have configured below token,

<row>
    <panel>
      <title>DB performance comparison for loading route map</title>
      <table>
        <title>DB performance comparison for loading route map</title>
        <search>
          <query> | dbxquery query="SELECT xx FROM xx  WHERE TIMESTAMP > add_days(now(),-$timerange_token$)"
         </query>
          <earliest>$timerange_token.earliest$</earliest>
          <latest>$timerange_token.latest$</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">10</option>
        <option name="dataOverlayMode">heatmap</option>
        <option name="drilldown">none</option>
        <option name="percentagesRow">false</option>
        <option name="refresh.display">progressbar</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
      </table>
    </panel>
  </row>

But somehow , it doesn't work the panel is always display waiting for input when I select a time period from the shared time picker.
alt text

If I hard code the date , it works
dbxquery query="SELECT xx FROM xx WHERE TIMESTAMP > add_days(now(),-2)"

I set time range for this panel to "TimeRange: Shared Time Picker (timerange_token) "
alt text

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...