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
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...