Dashboards & Visualizations

scale color with value in %

jip31
Motivator

Hi

I need to do a scale color on a value in % but nothing happens
my search is
eventtype=Charge
| stats first(FullChargedCapacity) AS FullChargedCapacity first(DesignedCapacity) AS DesignedCapacity first(_time) AS _time BY host
| eval Wear_Rate = 100-(FullChargedCapacity *100/DesignedCapacity)
| where Wear_Rate >5
| eval Wear_Rate=round(Wear_Rate, 1). " %"
| table time host FullChargedCapacity DesignedCapacity Wear_Rate

Could you help me please??

Tags (1)
0 Karma
1 Solution

Sukisen1981
Champion

hmm is it possible to sort Wear_Rate from smallest o largest?
If yes, then you need to apply this code to your simple xml[#FFFFFF,#006D9C]
<scale type="sharedCategory"></scale>
</format>

add this just before the closing tag.This is not exact and you do need to add |sort Wear_Rate
Check the output and see how it looks

View solution in original post

0 Karma

Sukisen1981
Champion

hmm is it possible to sort Wear_Rate from smallest o largest?
If yes, then you need to apply this code to your simple xml[#FFFFFF,#006D9C]
<scale type="sharedCategory"></scale>
</format>

add this just before the closing tag.This is not exact and you do need to add |sort Wear_Rate
Check the output and see how it looks

0 Karma

jip31
Motivator

I use secheduled reports the code is not in xml....



| loadjob savedsearch="admin:toto:tata"
-30d@d
now

cell



0 Karma

Sukisen1981
Champion

Hmmm there is a problem then 🙂
Basically, you can not apply a scale to a string,whether you use eval or fieldformat.
Is a work around possible? Instead of using | eval Wear_Rate=round(Wear_Rate, 1). " %"
can you use something like | eval Wear_Rate_percentage=round(Wear_Rate, 1)
and then you can use the default scale coloring.
So that your column remains a number and you intimate users through the column heading that this is a percentage figure?

0 Karma

jip31
Motivator

Thank you.

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...