Dashboards & Visualizations

Splunk cloud- How to change the background color of a dashboard in the source code

dkgs
Communicator

Hi,

I need to change the back ground color of a dashboard in splunk cloud. How can we achieve the same in the source code.  Can we directly add in the source code as we cannot place the files in bin folder of splunk cloud due to access issue

Attaching the image of the dashboard.

dkgs_0-1599032538254.png

 

 

Labels (4)
0 Karma
1 Solution

Nisha18789
Builder

Hello @dkgs , with my changes, panel remains unaffacted, it only changes the background of the dashboard.

Is this what you want?

Capture.PNG

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

Is this the sort of thing you are after?

  <row depends="$STYLES$">
    <panel>
      <html>
        <style>
          .main-section-body
          {
            background:greenyellow !important;
          }
        </style>
      </html>
    </panel>
  </row>

dkgs
Communicator

@ITWhisperer  Only the background color .The panels need to be not the same color.

When I added your below code, the complete dashboard is becoming that color. Could you please suggest how can i exclude panels from that

<row depends="$STYLES$">
<panel>

<html>
<style>
.main-section-body
{
background:red !important;
}
</style>
<p>
<center><a href="http://abc.com" style="color:black;" alignment="central">BLOCK</a></center>
</p>
</html>
</panel>
<panel>
<html>


<p>
<center><a href="http://abc.com" style="color:black;">High Disk %</a></center>
</p>
</html>
</panel>

0 Karma

Nisha18789
Builder

hi @dkgs , you can use css to do so, add a hidden row for css like 

<row>
<panel depends="$alwaysHideHTMLStyle$">
<title>`for css(do not delete)</title>
<html>
<style>

body{margin-bottom: 150px;background: #0f1b1f !important;}

.dashboard-body{background-color:#0f1b1f!important; font-weight:bold!important}


</style>

</html>
</panel>
</row>

dkgs
Communicator

@Nisha18789  thank you. I need only back ground color , the panels need not be in the same color

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Hi @dkgs 

If you are using Chrome or similar as your browser, you can inspect the dashboard and look at the various styles that have been applied to different parts of the page and work out which classes you want to change, then modify the css to change the style for those classes e.g. look for the classes applied to the panel and reset the background for that class. By the way, if you give your panels ids, you can apply different styles to different panels based on their names.

0 Karma

Nisha18789
Builder

Hello @dkgs , with my changes, panel remains unaffacted, it only changes the background of the dashboard.

Is this what you want?

Capture.PNG

dkgs
Communicator

@Nisha18789  Thank  you This works.

Could you please suggest if I need to add a static image inside each panel, what is the code to be added. We are using splunk cloud not the enterprise . 

<panel depends="$alwaysHideHTMLStyle$">

<html>
<style>

body{margin-bottom: 150px;background: #F08080!important;}

.dashboard-body{background-color:#F08080!important; font-weight:bold!important}


</style>
<p>
<center><a href="http://abc.com" style="color:black;" alignment="central">BLOCK</a></center>
</p>
</html>
</panel>
<panel>

0 Karma

Nisha18789
Builder

Thanks @dkgs, I have not used Splunk Cloud yet so I am not sure if the approach would be same as Splunk Enterprise. Could you check if below link is helpful?

https://docs.splunk.com/Documentation/SCS/current/Viz/Addimages

 

 

Get Updates on the Splunk Community!

Financial Services Industry Use Cases, ITSI Best Practices, and More New Articles ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Splunk Federated Analytics for Amazon Security Lake

Thursday, November 21, 2024  |  11AM PT / 2PM ET Register Now Join our session to see the technical ...

Splunk With AppDynamics - Meet the New IT (And Engineering) Couple

Wednesday, November 20, 2024  |  10AM PT / 1PM ET Register Now Join us in this session to learn all about ...