Splunk ITSI

How to change font color in dashboard table?

logankinman99
Path Finder

Hi, I'm looking to change the font of a statistics table within my dashboard.
It defaults at white, but when you edit the drilldown to allow clicks, it defaults to blue and is much harder to read at a distance.

Is there any way you know of to change this back?

(Notes: I tried charting.fontColor, but it is not compatible with stats tables apparently. Also I am using Splunk Cloud and do not have direct access to config/css files)

Labels (1)

Taruchit
Contributor

Hi All,

I need your assistance similar to the topic of this thread. 

I have a table which has two columns: - Color and Description

I created the table with following SPL: -

<row>
	<panel>
		<table>
			<search>
				<query>
| makeresults
|eval Color="0", Description="Color = 0"
|append
[| makeresults
eval Legend=""
|eval Color="-1", Description="Color = -1"]| append
[| makeresults |
eval Color="1", Description="Color = 1"] | table Color, Description | sort Color
</query>
			</search>
			<format type="color" field="Color">
				<colorPalette type="map">{"0":#4FA484,"-1":#AF575A,"1":#006D9C}</colorPalette>
			</format>
		</table>
	</panel>
</row>

It gives a table with two columns, the first column has color in each cell based on the value. 

I need to make text color same as the respective background color so that text can be hidden. Thus, need your guidance related to it.

table.png

Thank you

0 Karma

arjunpkishore5
Motivator

You can add css within your dashboard without the need for installing css or javascript files. Add this to the SimpleXML

  <row>
    <panel depends="$hidden$">
      <html>
        <style>
          table th td {
  color:#4f34eb;
}
          table tr td {
  color:#fc0303;
}

table.table-drilldown tr td {
color:#000000;
}

        </style>
      </html>
    </panel>
    </row>

Change the values of color to whatever you want.
table th td This section is for the table headers
table tr td This section is for the table rows
table.table-drilldown tr td This section is for the table rows when you have a drilldown

You don't need to use all 3. Use whichever you want to modify

hope this helps

a1bg503461
Explorer

So far pretty useful to my dashboard but do you know how to add conditions  as such :

 

LogLevel : INFO -> Blue

LogLevel : WARRNING -> Yellow

LogLevel : Error -> Red

630.PNG

0 Karma

esnyder_splunk
Splunk Employee
Splunk Employee

Do you mean a glass table? Or a separate dashboard within ITSI? Also what version?

0 Karma

a1bg503461
Explorer

We are using Splunk Enterprise Version: 9.3.1 and we need it for Classic Dashboard 

What I managed to put together is this :

      <html>
      <style type="text/css">
        

table tr:nth-child(odd) td{color: red;
}
table tr:nth-child(even) td{color: green;
}

</style>
      </html>


It looks like this :

 

a1bg503461_0-1732627093838.png

 

 

What I actually need is to Select rows Containing  INFO / ERROR / WARNING and color them RED , BLUE , YELLOW

0 Karma
Get Updates on the Splunk Community!

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...

State of Splunk Careers 2024: Maximizing Career Outcomes and the Continued Value of ...

For the past four years, Splunk has partnered with Enterprise Strategy Group to conduct a survey that gauges ...

Data-Driven Success: Splunk & Financial Services

Splunk streamlines the process of extracting insights from large volumes of data. In this fast-paced world, ...