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!

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