Splunk Search

Time modifier - tstats - subsearch

jcart11entergy
Engager

I am trying to compare two different results using subsearch. Both searches are using tstats. I am wanting the tstats inside the subsearch to search for -1h@h before whatever time is set in the time range picker. I saw other posts about using eval and tokens, but since tstats has to be at the beginning of the search string, and the time modifier is located withing the WHERE section, how can i handle the second time range?

| tstats count from datamodel=blah WHERE earliest=fromTimePicker.Earliest latest=fromTimePicker.Latest blah1, blah2, etc.... | search NOT [ | tstats count from datamodel=blah WHERE fromTimePicker.Earliest.value-2h latest=fromTimePicker.Earliest.value blah1, blah2, etc....

Tags (1)
0 Karma
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, ...