|
In this app I'm working on, I would like to restrict what the users can select from the time range picker. Specifically, I'm looking to remove the real time and all time options. In addition, I am re-ordering some of the items. I copied $SPLUNK_HOME/etc/system/default/times.conf to $SPLUNK_HOME/etc/apps/$app_name/system/default and modified it. Running ./splunk cmd btool times list --debug shows it picking up the configuration from the app specific times.conf. Unfortunately, in the advanced xml dashboard I'm working on that has the TimeRangePicker but still shows the standard time dropdowns. Any ideas? |
|
Update: According to another answer by caphrim007 that there is a With all config files, the stanzas in scope are merged by stanza to generate the configuration that is relevant. In the case of times.conf, each time range is a separate stanza, so unless you disable on that is inherited from the system, it will remain. There is no explicit "disable" option that you can provide in your app to override/disable the inherited. However, an embarrassing workaround is to set: sub_menu = _non_existent_sub_menu for each stanza/range that you want removed from your app in your app's times.conf. This will suppress the respective stanza/range as long as there is no sub-menu by that name. Regarding I like that - "embarrassing work around". I recopied the times.conf over, modified it so that the pre-set time ranges were set to a non existant sub menu. Unfortunately the "Custom Time" range is still available, and sub-menu's are still visible even if they don't have any time ranges under them. I'm thinking this may have to be changed into an enhancement request - seems like we need to have more control over the "TimeRangePicker" module.
(03 Sep '10, 12:10)
Brian Osburn
I think you can get rid of a sub menu by setting it's sub menu property to a non existent sub menu as well, but I don't know if there's a way to turn off the "custom time" option. I had a bug filed on this and it is marked "fixed", so perhaps you can use "disabled = true" or "enabled = false" and it's just not documented.
(03 Sep '10, 14:07)
gkanapathy ♦
|
|
I can verify what gkanapathy said about "disabled = true"
works to remove the "Other" and "Real-time" menus from the TimeRangePicker if you add them to a times.conf in your app's default or local directory. Using splunk 4.1.4 |
