Splunk Search

How to change the time range for a subsearch?

rameshlpatel
Communicator

Hi,

I am creating a search that will take date range from datetime field that I have created above. However, inside that search I am using a subsearch which needs last week's avg data. To get that, I have to fetch last week data and make an average for it.

How do I apply last week's time range for the subsearch?

Kindly assist.

Tags (2)
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

You can set the inner time range using explicit earliest and latest:

outer search ... [search earliest=-w latest=now inner search ...] ...

That will override the outer time range for the inner search.

Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...