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

0 Karma
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...