Splunk Search

How to use the specified time query in join search

mia
Explorer

A dashboard has a time range selector.

has a query search like below, the first search will apply the time range selector.

but the second search I want to set the earliest is the range selector earliest -7d@d 

Does anyone know how to do this?

ex: today: 9/20,  time range selector: 9/14~9/22,I excepted the second search is 9/7~9/22

 

index="*" host="...

| join type=left max=0 uid
[search earliest=???  latest=$earliest$ index="*" host="...

]

...

Thanks.

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

index="*" host="...

| join type=left max=0 uid
[search [| makeresults | addinfo | eval earliest=relative_time(info_min_time, "-7d@d") | eval latest=info_min_time | table earliest latest ] index="*" host="...

]

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

index="*" host="...

| join type=left max=0 uid
[search [| makeresults | addinfo | eval earliest=relative_time(info_min_time, "-7d@d") | eval latest=info_min_time | table earliest latest ] index="*" host="...

]
0 Karma

mia
Explorer

wow, amazing...this is the result I want

Respect! 

Thanks a lot.

0 Karma
Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...