Splunk Dev

help to color sinle value in css

jip31
Motivator

hello

i use the code below in order to color single value in green if value is GOOD or in red if value is bad
but it doesnt works
what is the pb please??

 <row>
     <panel id="my_pannel">
       <title>Disk Remaining Space Status</title>
       <single>
         <title>Good : > 15% - Bad : < 15%</title>
         <search>
           <query>| loadjob savedsearch="admin:FO_Workstations_Monitoring:FO_Workstations_Disk_Size" 
 | search host="$tok_filterhost$" 
 | fields - host | fields - host | eval background=if(Free_Space="OK", "GOOD", "BAD")| eval background=if(Free_Space="OK", "green", "red")  </query>
           <earliest>-30d@d</earliest>
           <latest>now</latest>
         </search>
         <option name="colorMode">block</option>
         <option name="refresh.display">progressbar</option>
         <option name="useColors">1</option>
       </single>
     </panel>
     <panel>
       <title>Disk Health Status</title>
       <single>
         <title>Good : Status = OK - Bad : Status = Not OK</title>
         <search>
           <query>| loadjob savedsearch="admin:FO_Workstations_Monitoring:FO_Workstations_Disk_Status" 
 | search host="$tok_filterhost$" 
 | fields - host | eval background=if(Free_Space="OK", "GOOD", "BAD")| eval background=if(Free_Space="OK", "green", "red")</query>
           <earliest>-30d@d</earliest>
           <latest>now</latest>
         </search>
         <option name="colorBy">value</option>
         <option name="colorMode">none</option>
         <option name="drilldown">none</option>
         <option name="numberPrecision">0</option>
         <option name="refresh.display">progressbar</option>
         <option name="showSparkline">1</option>
         <option name="showTrendIndicator">1</option>
         <option name="trendColorInterpretation">standard</option>
         <option name="trendDisplayMode">absolute</option>
         <option name="unitPosition">after</option>
         <option name="useColors">0</option>
         <option name="useThousandSeparators">1</option>
       </single>
     </panel>
   </row>
   <row id="hidden_row">
     <panel>
       <html>
         <style>
           #hidden_row{
              display:none !important;
          }
           #my_pannel .single-value svg.svg-container {
               background:$background$;
            }
         </style>
        </html>
Tags (1)
0 Karma
1 Solution

niketn
Legend

@jip31 this seems to be duplicate of your previous question: https://answers.splunk.com/answers/711285/can-you-help-us-change-the-color-on-the-background.html

Kindly keep single thread for same issue. I have provided a run any where example with rangemap to color single value. Also tried to map with your existing query. In case it does not work provide details to clarifications I have posted on the original thread!

All the best!

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

jip31
Motivator

Yes your are right sorry
I close this question and I give you all explanations in the original topic in a few minutes

0 Karma

nikita_p
Contributor

Hi,
Have you checked below link of splunk documentation? This might be helpful
https://docs.splunk.com/Documentation/Splunk/7.2.1/Viz/SingleValueFormatting

0 Karma

jip31
Motivator

hi
yes but its not exactly my problem
with GOOD or BAD i cant use the Format > Color Ranges

0 Karma

jip31
Motivator

hi not really sorry....

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...