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!

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to Officially Supported Splunk ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI! Discover how Splunk’s agentic AI ...