Dashboards & Visualizations

TimePicker: Limit the choices on a specifique Dashboard without touching the .conf

henriq_c
Explorer

Hi,

I have two dashboard :
- "Normal" dashboard : With the basic TimePicker.
- Another dashboard : where I want to remove 'Other'( All time) for the timepicker

How can i remove this choice in the Time Picker ?

PS : I can't (don't want to) touch the splunk files

Thanks

0 Karma
1 Solution

vnravikumar
Champion

Hi @henriq_c

Try with following CSS change (verified in splunk 7.2.4)

<form>
  <label>timepicker</label>
  <fieldset submitButton="false">
    <input type="time" token="field1" id="test">
      <label></label>
      <default>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </default>
    </input>

  </fieldset>
  <row depends="$hide$">
    <panel>
      <html>
        <style>
          div[data-test="other-column"]
          {
          display:none !important;
          }
        </style>
      </html>
    </panel>
  </row>
</form>

[Updated] Splunk 6.x

<form>
  <label>timepicker</label>
  <fieldset submitButton="false">
    <input type="time" token="field1" id="test">
      <label></label>
      <default>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </default>
    </input>
  </fieldset>
  <row depends="$hide$">
    <panel>
      <html>
        <style>

            div[data-view="views/shared/timerangepicker/dialog/Presets"] ul:last-child {
                display:none;
          }
        </style>
      </html>
    </panel>
  </row>
</form>

View solution in original post

0 Karma

vnravikumar
Champion

Hi @henriq_c

Try with following CSS change (verified in splunk 7.2.4)

<form>
  <label>timepicker</label>
  <fieldset submitButton="false">
    <input type="time" token="field1" id="test">
      <label></label>
      <default>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </default>
    </input>

  </fieldset>
  <row depends="$hide$">
    <panel>
      <html>
        <style>
          div[data-test="other-column"]
          {
          display:none !important;
          }
        </style>
      </html>
    </panel>
  </row>
</form>

[Updated] Splunk 6.x

<form>
  <label>timepicker</label>
  <fieldset submitButton="false">
    <input type="time" token="field1" id="test">
      <label></label>
      <default>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </default>
    </input>
  </fieldset>
  <row depends="$hide$">
    <panel>
      <html>
        <style>

            div[data-view="views/shared/timerangepicker/dialog/Presets"] ul:last-child {
                display:none;
          }
        </style>
      </html>
    </panel>
  </row>
</form>
0 Karma

henriq_c
Explorer

It doesnt work. It does not remove the 'Other' category from the time picker 😕

0 Karma

vnravikumar
Champion

please let me know your splunk version.

0 Karma

vnravikumar
Champion

@henriq_c i had updated code for Splunk 6.x please try and let me know.

0 Karma

henriq_c
Explorer

v7.02 (it works with the 6.x code)

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...