Splunk Search

How to change the default formatting for a table visualization?

gavinsopra
Engager

I would like to change some of the formatting of a Statistics Table in a dashboard, specifically the following:

  • header row background
  • alternate row backgrounds
  • text colour

I have found a number of articles that talk about changing rows or cells based on values in the table but that's not what I want. I just need to manipulate the CSS (I guess) so that I can apply our 'house style' to the tables.

I would like to apply different colour schemes to different tables in the same dashboard.
I am running Splunk Enterprise 8.0.2.

Is this possible?

0 Karma
1 Solution

niketn
Legend

For changing table header color try the following answer of mine. This answer also shows use of Browser Inspector for CSS Style Override. You can check out existing DOM path and corresponding bootstrap css that you need to override.: https://answers.splunk.com/answers/593399/column-headers-color.html

Do install Splunk Dashboard Examples app from Splunkbase and check out Custom Layout Dark example with dark.css which lists a lot of CSS Style Selectors for various Splunk Elements including table.

For Splunk Style Guide including table, change your Splunk URL to the following location and check out which classes can be used for Bootstrap to work:

http://<yourSplunkServer>:8000/en-US/static/docs/style/style-guide.html#tables

For your specific query, add the following to your existing dashboard with table to test Table Header Color and Alternate row color CSS (PS: Table Cell color formatting will stop working because of this static CSS Style override):

  <html depends="$alwaysHideCSSStyle$">
    <style>
       .table th {
          background-image: linear-gradient(to bottom, #006297, #006297) !important;
          text-shadow: none !important;
       }
       .table th a{
          color: white !important;
       }
      table tr.odd td{
        background: #7ED2FF !important;
      }
      table tr.even td{
        background: #007ABD !important;
      }
      table tr td{
        color: #fff !important;
      }
    </style>
  </html>

Idea is to quickly test in Dashboard and once finalized move to actual CSS file.

Please try out and confirm!

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

View solution in original post

Get Updates on the Splunk Community!

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...