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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...