Dashboards & Visualizations

How come the dashboard panel time token is not populating in the title as expected?

DEAD_BEEF
Builder

I have a single value dashboard panel that counts the number of hosts by IP address. I am listing the time range of the search in the title of the panel using $earliest_d$ and $latest_d$ tokens. For some unknown reason, only $latest_d$ is working and displaying the end time of the search. I am going in circles trying to figure out why the earliest time field isn't loading as expected.

alt text

<form>
  <label>Test</label>
  <fieldset submitButton="false" autoRun="true"></fieldset>
  <row>
    <panel>
      <title>Unique Devices</title>
      <single>
        <title>$earliest_d$ - $latest_d$</title>
        <search>
          <done>
            <eval token="earliest_d">strftime(relative_time(now(), $job.request.earliest_time$), "%d %b %T")</eval>
            <eval token="latest_d">strftime(relative_time(now(), $job.request.latest_time$), "%d %b %T")</eval>
          </done>
          <query>| tstats dc(host) AS Hosts where (index=a* OR index=b*)</query>
          <earliest>-d@d</earliest>
          <latest>@d</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="colorBy">value</option>
        <option name="colorMode">none</option>
        <option name="drilldown">none</option>
        <option name="numberPrecision">0</option>
        <option name="rangeColors">["0x65a637","0x65a637"]</option>
        <option name="rangeValues">[0]</option>
        <option name="showSparkline">1</option>
        <option name="showTrendIndicator">1</option>
        <option name="trellis.enabled">0</option>
        <option name="trellis.scales.shared">1</option>
        <option name="trellis.size">medium</option>
        <option name="trendColorInterpretation">standard</option>
        <option name="trendDisplayMode">absolute</option>
        <option name="underLabel">Unique Hosts</option>
        <option name="unitPosition">after</option>
        <option name="useColors">1</option>
        <option name="useThousandSeparators">1</option>
      </single>
    </panel>
  </row>
</form>
0 Karma
1 Solution

Vijeta
Influencer

Change <earliest>-d@d</earliest> to <earliest>-1d@d</earliest>, this worked for me.

View solution in original post

0 Karma

Vijeta
Influencer

Change <earliest>-d@d</earliest> to <earliest>-1d@d</earliest>, this worked for me.

0 Karma

DEAD_BEEF
Builder

Why it wouldn't work with -d vs -1d is a mystery. Thank you, this worked perfectly, thank you!

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

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 ...