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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...