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!

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, ...