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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

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 GA in US-AWS!

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