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!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...