All Apps and Add-ons

How to change parameter of hidden search to update its time from timerangepicker?

ibra75
Explorer

hello splunkers,
I execute a hidden search whose default earliest time's Last 7 days. When I change the time period in the TimeRangePicker (for example Last 30 days), it restarts the search but it does not take into account the new chosen range time.
How can I change the parameter of the hidden search to update its time value from the TimeRangePicker?
thanks

0 Karma

sideview
SplunkTrust
SplunkTrust

It sounds like you've given the Search module an earliest and latest param such that that module itself specifies a timerange of last 7 days.

If this module is downstream from the TimeRangePicker, then indeed, that hardcoded timerange will override the TimeRangePicker's timerange.

I would remove those earliest/latest params from the Search module, and instead put <param name="default">last 7 days</param> into the TimeRangePicker itself.

The Search module can certainly prepopulate timeranges in TimeRangePicker, but only in cases where they are upstream from the TimeRangePicker.

UPDATE - short version -- for the Search module (or the legacy HiddenSearch module) to inherit it's timerange from an upstream TimeRangePicker, it needs to have no "earliest" or "latest" params itself.

0 Karma

somesoni2
SplunkTrust
SplunkTrust

can you provide your dashboard xml? Also, instead of defining default earliest time at hiddensearch, just set the default time in the timepicker (don't specify anything in hidden search, so it should take time directly from timepicker)

Get Updates on the Splunk Community!

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...