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!

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

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

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...