All Apps and Add-ons

How to change single value panel color based on other text value?

satishshah158
Loves-to-Learn Lots

Hi Splunkers, I have a requirement to show a single value panel with the total number of connections to a server and change the color to RED of the panel when the connection is down (which is not being shown on the panel). I've tried using the classField and range but it seems those are depreciated.

I tried searching this forum but couldn't find any relevant options.
Is there any other alternative to get this done?
Please help.

Data:
session - name of the session (can be many)
server - server name can be many (used trellis for this purpose)
STATUS - Status of the connected, can be either UP or DOWN.

I've used rangevalues in the below simple xml which isnt working as expected.

 

 

 

<form>
<label>Color My Text</label>
<fieldset submitButton="false">
<input type="time" token="time">
<label>time</label>
<default>
<earliest>-24h@h</earliest>
<latest>now</latest>
</default>
</input>
</fieldset>
<row>
<panel>
<single>
<search>
<query>index=*
| stats count by session,server,STATUS
| foreach server [eval range=if('STATUS'="DOWN","severe", "low")]
| chart count by server</query>
<earliest>$time.earliest$</earliest>
<latest>$time.latest$</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="classField">range</option>
<option name="colorBy">value</option>
<option name="colorMode">block</option>
<option name="drilldown">none</option>
<option name="field">count</option>
<option name="numberPrecision">0</option>
<option name="rangeColors">["0x53a051","0xdc4e41"]</option>
<option name="rangeValues">[1]</option>
<option name="refresh.display">progressbar</option>
<option name="showSparkline">1</option>
<option name="showTrendIndicator">1</option>
<option name="trellis.enabled">1</option>
<option name="trellis.scales.shared">1</option>
<option name="trellis.size">small</option>
<option name="trellis.splitBy">server</option>
<option name="trendColorInterpretation">standard</option>
<option name="trendDisplayMode">absolute</option>
<option name="unitserver">after</option>
<option name="useColors">1</option>
<option name="useThousandSeparators">0</option>
</single>
</panel>
</row>
</form>

 

 

 

Labels (3)
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...