Splunk Search

How to search with times from another search?

nkuriger
New Member

Hi. I've got a search looking for times and dates with "index=main host=web1 "/blarg=foo"| table _time" how can I use the results to to search with "index=main host=app1 blarg" during the times from the first search?

Labels (1)
Tags (1)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

You can modify your search so that it returns pair(s) of fields called earliest and latest.

You can then use it as a subsearch which will be expanded in runtime.

For example, this will search from index A only during those periods each day that there are events in index B

index=A
[ index=B
| bin _time as day span=1d
| stats earliest_time as earliest latest_time as latest by day
| table earliest latest ]

All typical caveats regarding subsearches apply.

0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

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

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...