Dashboards & Visualizations

Simple xml table - Colorize the Total line

guilmxm
SplunkTrust
SplunkTrust

Hi All,

I would like to able to colorize the "TOTAL" line in simple xml tables as follows:

<table>
  <searchString>MYSEARCH | addcoltotals labelfield="myfield" label=TOTAL</searchString>
  <earliestTime>$earliest$</earliestTime>
  <latestTime>$latest$</latestTime>
  <option name="wrap">true</option>
  <option name="rowNumbers">false</option>
  <option name="dataOverlayMode">none</option>
  <option name="drilldown">row</option>
  <option name="count">10</option>
</table>

The addcoltotals will add a line called TOTAL at the end of my table, i would like to floddlight this line with a specific color, is there a way to achieve it ? Using css maybe ?

Thanks for your help

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi guilmxm,
I suggest to download and install the Splunk 6.x Dashboard Examples App (https://splunkbase.splunk.com/app/1603/) in which you can find an example to color all the TOTAL Row or the Total Cell.
Bye.
Giuseppe

0 Karma

simon21
Path Finder

please try the below code:

abc.css

"#id_of_table tr:nth-last-child(1) td {
background: #6DB7C6;
color: black;
}

add the "abc.css" in your dashboard or form using stylesheet tag.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

You could define CSS something like this (untested):

#your-table-id tr:last-child {
  background-color: #123456;
}

The idea is as follows: Locate your table based on its id, descend into the last tr element, and colour that appropriately. A word of warning for corporate environments, older versions of IE don't support these CSS3 pseudo-classes.

guilmxm
SplunkTrust
SplunkTrust

Hi,

Many thanks for your answer.

Indeed i think this is the solution, however something inherited by an other css file seems to prevent it to work as for now. (even with important statement within the css)

Still working on it and will revert

0 Karma

simon21
Path Finder

please try the below code:

abc.css

"#id_of_table tr:nth-last-child(1) td {
background: #6DB7C6;
color: black;
}

add the "abc.css" in your dashboard or form using stylesheet tag.

0 Karma
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 ...