Splunk Search

Making a drilldown search in a different timespan from its parent modules?

jwestberg
Splunk Employee
Splunk Employee

I have a search that searches in a time span set by a TimeRangePicker. I would like for the drilldown search that I produce to not take place in that same timespan, but rather over all time.

How can I accomplish this?

Tags (3)
0 Karma
1 Solution

sideview
SplunkTrust
SplunkTrust

Your view has to be written using the advanced XML, or converted to the advanced XML, but aside from that it's fairly simple.

In the advanced XML the nesting of module tags inside other module tags looks very confusing at first but this just encodes how modules get information from other modules.

So if a given module is inside a 'TimeRangePicker' module, it will inherit that TimeRangePicker's current time range. And if it's outside it wont know about it.
Furthermore for simple items like the base search string and the timerange, you can also clobber upstream changes by having another deeper module specify those keys again.

So making a change like this amounts to indenting some set of modules on the inside, and adding a new HiddenSearch module with a new timerange that replaces the one from higher up.

[[ the last of the modules you want to operate on the old timerange]]
<module name="HiddenSearch">
  <param name="earliest">-7d@d</param>
  <param name="latest">+1d@d</param>
  [[ (newly indented) all modules from here down will operate on the 'last 7 days' timerange]]                
</module>

The bad news is that it looks like there's no way to set it to All Time. This is more or less because the 'all time' timerange is really the absence of a timerange, and the params on HiddenSearch arent smart enough to know the difference between not wanting to set earliest/latest, and wanting to set it to an explicit null...

View solution in original post

sideview
SplunkTrust
SplunkTrust

Your view has to be written using the advanced XML, or converted to the advanced XML, but aside from that it's fairly simple.

In the advanced XML the nesting of module tags inside other module tags looks very confusing at first but this just encodes how modules get information from other modules.

So if a given module is inside a 'TimeRangePicker' module, it will inherit that TimeRangePicker's current time range. And if it's outside it wont know about it.
Furthermore for simple items like the base search string and the timerange, you can also clobber upstream changes by having another deeper module specify those keys again.

So making a change like this amounts to indenting some set of modules on the inside, and adding a new HiddenSearch module with a new timerange that replaces the one from higher up.

[[ the last of the modules you want to operate on the old timerange]]
<module name="HiddenSearch">
  <param name="earliest">-7d@d</param>
  <param name="latest">+1d@d</param>
  [[ (newly indented) all modules from here down will operate on the 'last 7 days' timerange]]                
</module>

The bad news is that it looks like there's no way to set it to All Time. This is more or less because the 'all time' timerange is really the absence of a timerange, and the params on HiddenSearch arent smart enough to know the difference between not wanting to set earliest/latest, and wanting to set it to an explicit null...

Get Updates on the Splunk Community!

Splunk Observability Synthetic Monitoring - Resolved Incident on Detector Alerts

We’ve discovered a bug that affected the auto-clear of Synthetic Detectors in the Splunk Synthetic Monitoring ...

Video | Tom’s Smartness Journey Continues

Remember Splunk Community member Tom Kopchak? If you caught the first episode of our Smartness interview ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud? Learn how unique features like ...