Splunk Search

Subsearch using time from lookup in main search

adamblock2
Path Finder

I am performing a lookup in a main search which returns earliest_event and latest_event timestamp values.  I would like to use these timestamp values as parameters for a subsearch.  The search would be similar to the following:

index=foo
...........
| lookup lookuptable.csv session_id OUTPUTNEW session_id, earliest_event, latest_event
...........
| append
[ search index=bar earliest=earliest_event latest=latest_event
...........]



The time parameters for the subsearch are not being accepted, though.

Is there a different way that this can be accomplished?

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Subsearches generally execute before the main search, which essentially means you cannot pass information from the main search to the subsearch as you are trying to do.

However, you might be able to do something with the map command rather than the append command, but this has performance implications, so proceed with caution. 😀

0 Karma
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...