- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to change stats to generate a single value background color AND font colour
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sorry i could not copy full xml code please refer below
option name="rangeColors">["0x65a637","0xf58f39","0xd93f3c"]option
option name="rangeValues">[1,2]/option>
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sorry i could not copy full xml code please refer below
option name="rangeColors">["0x65a637","0xf58f39","0xd93f3c"]option
option name="rangeValues">[1,2]/option>
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks working for me
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Happy Splunking
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sorry Unable to do , can u pls provide full code :
my splunk code is :
index="index" | rex "(?:[^\t\n]\t){16}(?P[^\t])"|rex "(?:[^\t\n]\t){17}(?P[^\t])" | rex max_match=0 "(?[^\<\"]*)"|eval reason_sub_code=substr(reasoncode,1,7) | search runcode=Failure
| stats count
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you should add this in dashboard XML go to edit source and add this this will not work as it is you need to adjust accordingly
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've added into dashboard like below but no use
<single>
<title>Authentication</title>
<search>
<query>index="index"| rex "(?:[^\t\n]*\t){16}(?P<runcode>[^\t]*)"|rex "(?:[^\t\n]*\t){17}(?P<reasoncode>[^\t]*)" | rex max_match=0 "<messageString>(?<reasoncode>[^\\<\"]*)"|eval reason_sub_code=substr(reasoncode,1,7) | stats count</query>
<sampleRatio>1</sampleRatio>
</search>
<option name="drilldown">all</option>
<option name="rangeColors">["0x65a637","0xf58f39","0xd93f3c"]</option>
<option name="rangeValues">[1,2]</option>
</single>
<single>
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is not the way to add dear
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
<title>Authentication</title>
<search>
<query>index="index"| rex "(?:[^\t\n]*\t){16}(?P<runcode>[^\t]*)"|rex "(?:[^\t\n]*\t){17}(?P<reasoncode>[^\t]*)" | rex max_match=0 "<messageString>(?<reasoncode>[^\\<\"]*)"|eval reason_sub_code=substr(reasoncode,1,7) | stats count</query>
<sampleRatio>1</sampleRatio>
</search>
<option name="drilldown">all</option>
["0x65a637","0xf58f39","0xd93f3c"]
[1,2]
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
see the image which i posted
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks ..working for me
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


Hi x05311,
you can configure your Single Value Panel to use colors for font or background using UI.
You can use different colors for different ranges of your values.
if you want to have only one color for all values (number or background) you can set the same color for every value of your results.
In other words:
- create your search with a stats command and a single value result;
- save it in a dashboard as Single Value Panel;
- set Format: Using Colors (by UI);
- set the colors of the values ranges.
Bye.
Giuseppe
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sorry Unable to do , can u pls provide full code :
my splunk code is :
index="index" | rex "(?:[^\t\n]\t){16}(?P[^\t])"|rex "(?:[^\t\n]\t){17}(?P[^\t])" | rex max_match=0 "(?[^\<\"]*)"|eval reason_sub_code=substr(reasoncode,1,7) | search runcode=Failure AND reason_sub_code="CAM-AAA"
| stats count
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

We need more information. stats cannot generate colors. In a dashboard, you can control the background color / value color for a single-value panel. If you could describe your data, what you need to calculate, and how you want to display it - then the community could probably make some good suggestions for you.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
index="index" | rex "(?:[^\t\n]\t){16}(?P[^\t])"|rex "(?:[^\t\n]\t){17}(?P[^\t])" | rex max_match=0 "(?[^\<\"]*)"|eval reason_sub_code=substr(reasoncode,1,7) | search runcode=Failure AND reason_sub_code="CAM-AAA"
| stats count
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Rangemap can be used to color Single Value visualization. https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Rangemap#Examples
However, Splunk recommends controlling colors by configuring ranges in visualization properties instead. https://docs.splunk.com/Documentation/Splunk/latest/Viz/SingleValueFormatting#Migration_for_rangemap...
| makeresults | eval message= "Happy Splunking!!!"
