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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...