Hi All,
I am having XML Dashboard in the below format, I have applied colorPalette expression in Splunk natively applying for the cell, but request was the color should apply only font colour not on cell.
If values are greater than 99.90, then font should be in green colour -->
If values are greater than 99 and less than 99.90, font should be in amber -->
If values are less than 99, font should be in Red-->
Incase null i have used fillnull as "-" ,should be grey or black-->
Can anyone please help on this to achieve the requirement.
Try something like this
<dashboard version="1.1" theme="light">
<label>Font colours</label>
<row>
<panel depends="$alwayshidden$">
<html>
<style>
#fontcolours div.multivalue-subcell[data-mv-index="0"] {
color: limegreen !important;
}
#fontcolours div.multivalue-subcell[data-mv-index="1"] {
color: orange !important;
}
#fontcolours div.multivalue-subcell[data-mv-index="2"] {
color: red !important;
}
#fontcolours div.multivalue-subcell[data-mv-index="3"] {
color: grey !important;
}
</style>
</html>
</panel>
<panel>
<table id="fontcolours">
<search>
<query>| makeresults count=10
| fields - _time
| eval A=100-(random()%201/100)
| eval B=100-(random()%201/100)
| eval C=100-(random()%201/100)
| foreach A B C
[| eval <<FIELD>>=case(<<FIELD>><=98.2,mvappend("","","","-"),<<FIELD>>>=99.90,mvappend(<<FIELD>>,"","",""),<<FIELD>>>=99,mvappend("",<<FIELD>>,"",""),true(),mvappend("","",<<FIELD>>,""))]</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
<option name="drilldown">none</option>
<option name="refresh.display">progressbar</option>
</table>
</panel>
</row>
</dashboard>Basically, you can colour font by selecting different multivalues
Thanks it works
Try something like this
<dashboard version="1.1" theme="light">
<label>Font colours</label>
<row>
<panel depends="$alwayshidden$">
<html>
<style>
#fontcolours div.multivalue-subcell[data-mv-index="0"] {
color: limegreen !important;
}
#fontcolours div.multivalue-subcell[data-mv-index="1"] {
color: orange !important;
}
#fontcolours div.multivalue-subcell[data-mv-index="2"] {
color: red !important;
}
#fontcolours div.multivalue-subcell[data-mv-index="3"] {
color: grey !important;
}
</style>
</html>
</panel>
<panel>
<table id="fontcolours">
<search>
<query>| makeresults count=10
| fields - _time
| eval A=100-(random()%201/100)
| eval B=100-(random()%201/100)
| eval C=100-(random()%201/100)
| foreach A B C
[| eval <<FIELD>>=case(<<FIELD>><=98.2,mvappend("","","","-"),<<FIELD>>>=99.90,mvappend(<<FIELD>>,"","",""),<<FIELD>>>=99,mvappend("",<<FIELD>>,"",""),true(),mvappend("","",<<FIELD>>,""))]</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
<option name="drilldown">none</option>
<option name="refresh.display">progressbar</option>
</table>
</panel>
</row>
</dashboard>Basically, you can colour font by selecting different multivalues