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

Improve Your Security Posture

Watch NowImprove Your Security PostureCustomers are at the center of everything we do at Splunk and security ...

Maximize the Value from Microsoft Defender with Splunk

 Watch NowJoin Splunk and Sens Consulting for this Security Edition Tech TalkWho should attend:  Security ...

This Week's Community Digest - Splunk Community Happenings [6.27.22]

Get the latest news and updates from the Splunk Community here! News From Splunk Answers ✍️ Splunk Answers is ...