Dashboards & Visualizations

How to include CSS in Dashboards with the latest Splunk version

shakura
Engager

Before our company's latest Splunk upgrade I was able to incorporate CSS code in my dashboards in the following way:

<form>

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

             [ CSS code goes here ]

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

<form>

However, after the upgrade, this piece of code doesn't seem to have any effect and I am unable to customize styling.

Our current Splunk version:
Splunk Enterprise
Version: 7.3.3

1 Solution

niketn
Legend

@shakura this is a known issue with 7.3.3 where CSS override from within the dashboard is not working. https://docs.splunk.com/Documentation/Splunk/7.3.3/ReleaseNotes/Knownissues#Uncategorized_issues

  1. You can either include the CSS as static stylesheet to your dashboard. https://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/UseCSS#Customize_styling_and_behavio...

  2. Or add a <p/> element before the <style> element in the dashboard. Refer to the workaround in the Splunk Answers post: https://answers.splunk.com/answers/789487/why-doesnt-css-work-in-dashboards.html

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

niketn
Legend

@shakura this is a known issue with 7.3.3 where CSS override from within the dashboard is not working. https://docs.splunk.com/Documentation/Splunk/7.3.3/ReleaseNotes/Knownissues#Uncategorized_issues

  1. You can either include the CSS as static stylesheet to your dashboard. https://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/UseCSS#Customize_styling_and_behavio...

  2. Or add a <p/> element before the <style> element in the dashboard. Refer to the workaround in the Splunk Answers post: https://answers.splunk.com/answers/789487/why-doesnt-css-work-in-dashboards.html

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...