Splunk Search

Relative Time Value to Timepicker Latest

hypePG
Path Finder

Hey,

I got a dashboard with different panels. They are all controlled by a single timepicker.
Usually the timeranges a several weeks. In one of the panels I want an overview for the last 24 hours relative to the latest time.

For Example:

Time range picked via the picker:
01.03.2019-8.03.2019
24h Overview should display events for this range:
07.03.2019-8.03.2019

I tried working with tokens and different method to calculate the new earliest time but didnt get it to work.
I think it will be a simple fix but I jsut cant get it atm.

Thanks in advance.

Max

0 Karma

vnravikumar
Champion

Hi @hypePG

Try like in that panel with

<row>
    <panel>
      <table>
        <search>
          <query>index="_internal" |stats count</query>
          <earliest>-24h@h</earliest>
          <latest>$time.latest$</latest>
        </search>
        <option name="drilldown">none</option>
      </table>
    </panel>
  </row>
0 Karma

hypePG
Path Finder

hey,

thanks for your answer! tried this already, i get the error message:

Invalid latest_time: latest_time must be after earliest_time. 

regards,

max

0 Karma

vnravikumar
Champion

are you passing timepickers latest time?

0 Karma

hypePG
Path Finder

yes i am:

    <search>
      <query>search</query>
      <earliest>-24h@h</earliest>
      <latest>$timepicker.latest$</latest>
      <sampleRatio>1</sampleRatio>
    </search>
0 Karma

vnravikumar
Champion

what is the time range that you have selected?

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...