Splunk Dev

Lookup with range

TISKAR
Builder

Hello Splunk

I will use lookup with earliest and latest like

I configured time based lookup but that not work, So i use:

earliest=relative_time(now(),"$time.earliest$") | where _time>earliest

Do you konow a solution without relative time, because with relative time i have multiple condition in my dasboards ?

Thank you

Tags (1)
0 Karma

DalJeanis
Legend

@Tiskar - did you intend to close the question, or to accept one of the answers?

0 Karma

woodcock
Esteemed Legend

If I understand you correctly, like this:

Your Regular Search WITHOUT earliest AND latest here [|inputlook YourLookupContainingBOTHearliestANDlatest | table earliest latest]

Do note that both earliest and latest in the lookup must be time_t integers (AKA epoch). If the format is anything else, you must convert them using strptime.

0 Karma

DalJeanis
Legend

Your dashboard can use a time picker to set tokens for a time range, and then you use

| where _time>=$token_for_earliest$ AND _time<$token_for_latest$

You can search around for more details in the docs (like the sample xml dashboards) and in answers like this one ...
https://answers.splunk.com/answers/591175/how-to-manipulate-a-timestamp-token-from-a-timesta.html

0 Karma

TISKAR
Builder

Thank you

But i alrady have a dashboard with time range picker, and i can't use | eval earliest_DB1 = strftime(@d, "%Y-%m-%d %H:%M:%S")

0 Karma

TISKAR
Builder

So i less my solution with relative time with multiple conditions like:

| eval earliest_DB1 = strptime(relative_time(now(), "@d"),.....)

where _time>earliest

Thnk youi can't accept my solution

0 Karma

DalJeanis
Legend

@TISKAR - I don't understand your comment. If you join the Splunk Slack channel, and go to the #dashboards subchannel, someone may be able to talk you through what you need.

0 Karma

adonio
Ultra Champion

hello there,
can you elaborate on your challenge? what is it exactly that you are trying to solve?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...

Index This | How many sevens are there between 1 and 100?

August 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...