Dashboards & Visualizations

How can I customize my dashboard using CSS?

Nadhiya123
Explorer

How to hide the time option in the dashboard without using the css but should function in the background ?

0 Karma
1 Solution

niketn
Legend

@Nadhiya123, can you please add more information for your requirement? Do you want to Hide the Time Picket Input? Do you want to do it with or without CSS? Do you want to toggle between hide and show option? Because, if you want to always hide the Time Picker it is better to use static time in your searches.

Which version of Splunk are you using? Since, from Splunk 6.5 onward all Splunk dashboard inputs can be hidden using Hide Filters link which is available by default when Form inputs are added to the Dashboard.

If not you can use depends attribute to hide a Splunk element like Time Picker using a token which is never set in the dashboard. Following is a dummy dashboard for example.

<form>
  <label>Hide Time Picker</label>
  <fieldset submitButton="false">
  </fieldset>
  <row>
    <panel>
      <input depends="$alwaysHideTimePicker$" type="time" token="tokTime">
        <label></label>
        <default>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </default>
      </input>
      <html>
        Earliest : $tokTime.earliest$ Latest: $tokTime.latest$ 
      </html>
    </panel>
  </row>
</form>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

Nadhiya123
Explorer

Hi @niketnilay ,

I have tried both ways.
1. .
2. hideFilters='true'

Its working for other input types except time option .Exactly I need to hide the time input in the dashboard. I don't want my users to change the time. Thats my requirement.

0 Karma

niketn
Legend

@Nadhiya123, can you please add more information for your requirement? Do you want to Hide the Time Picket Input? Do you want to do it with or without CSS? Do you want to toggle between hide and show option? Because, if you want to always hide the Time Picker it is better to use static time in your searches.

Which version of Splunk are you using? Since, from Splunk 6.5 onward all Splunk dashboard inputs can be hidden using Hide Filters link which is available by default when Form inputs are added to the Dashboard.

If not you can use depends attribute to hide a Splunk element like Time Picker using a token which is never set in the dashboard. Following is a dummy dashboard for example.

<form>
  <label>Hide Time Picker</label>
  <fieldset submitButton="false">
  </fieldset>
  <row>
    <panel>
      <input depends="$alwaysHideTimePicker$" type="time" token="tokTime">
        <label></label>
        <default>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </default>
      </input>
      <html>
        Earliest : $tokTime.earliest$ Latest: $tokTime.latest$ 
      </html>
    </panel>
  </row>
</form>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

Nadhiya123
Explorer

@ niketnilay

Yes it works only on giving the row and panel syntax.

Thank you for your support!

0 Karma

kashz
Explorer

I'm constantly seeing depends="$alwaysHideCSS" and depends="$hiddenForCSS$" .
Can someone please explain this and provide some splunk / css documentation on it?

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...