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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...