Splunk Search

How to set default Time range always when the View loads

tkadale
Path Finder

I want to set default time range to Last 7 days from All Time when View loads every time. I have put the times.conf from /system/default to app/default directory. Then added last_7_days this parameter to TimeRangePicker module. but still it doesnt work? What should I do?

Tags (1)
0 Karma

hazekamp
Builder

I would recommend setting this via a local/viewstates.conf in your app. For instance:

## viewstates.conf
[mydashboard:_current]
TimeRangePicker_0_1_0.default = Last 7 days

There are 2 variables here that will need modification.

  1. mydashboard should reflect the name of your view
  2. _0_1_0 should reflect the module ID of TimeRangePicker in your view. This can be found in a couple of different ways. The easiest of which is probably by looking at the viewstates.conf from your users directory. $SPLUNK_HOME/etc/users/<your_user>/<your_app>/local/viewstates.conf. You could also specify "?showsource=1" in the browser URL just after the view name. This will give you a breakdown of modules and their respective IDs.
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

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 ...