Dashboards & Visualizations

In a dashboard, can we change background color for the Splunk input choices ?

VI371887
Path Finder

I have a dashboard where panels hide/show according to the linked list choices you are making,

Now, i want the choices to have a specific color change and font color. So, when i am trying to use a certain background color, all of the linked list would that background color.

 <panel>
    <html>
     <style>
       #link  {         
             color: black !important;
             font-weight: bold !important;
             background: #e3e7ea !important;


 }
         </style>    </html>     </panel> 
0 Karma

kumaranv
Path Finder

Perfect. It works. Thanks

<row>
<panel depends="$hide$">
<html>
<style>

#list button{
color: blue;
background: $background_color_token$;
}

</style>
</html>
</panel>
<panel id="list">
<input type="link" token="field1">
<label>field1</label>
<choice value="1">One</choice>
<choice value="2">Two</choice>
<choice value="3">Three</choice>
<default>1</default>
<change>
<condition value="1">
<set token="background_color_token">blue</set>
</condition>
<condition value="2">
<set token="background_color_token">green</set>
</condition>
<condition value="3">
<set token="background_color_token">red</set>
</condition>

</change>
</input>
</panel>
</row>

0 Karma

payl_chdhry
Path Finder

@VI371887 know this is very old post, but were you ever successful in doing this?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You can use tokens in the CSS.

background-color: $background_color_token$ |important;

 Set the token elsewhere in the dashboard.

0 Karma

kumaranv
Path Finder

Could you please provide an example of passing token into CSS attributes. Thanks

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

That is an example of a token being used in CSS. The token needs to be set to a value elsewhere in the dashboard.

0 Karma
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...