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 Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...