It seems the SingleView visualization in Web Framework v1.2 in Splunk 6.3 introduced a bunch of properties, one of them being called numberPrecision. The default is 0
with available options being adding up to 4 zeroes (like 0.0000
).
I have a custom dashboard which displays percentages in single visualizations, and I want to use the decimal places but only when they are available. If the value is an integer (100%), I don't want to have extra zeroes added to it:
I don't see a way to do it with the current controls, something like "only round if not integer". Does anyone have any ideas?
Thank you
your query ...... | eval splits=split(value,".") | eval count=mvcount(splits) | eval value=if(count>1,value,mvindex(splits,0)) | eval value=value."%" | table value
Now choose your visualization to be "single value".
your query ...... | eval splits=split(value,".") | eval count=mvcount(splits) | eval value=if(count>1,value,mvindex(splits,0)) | eval value=value."%" | table value
Now choose your visualization to be "single value".
This works, but I just needed to round the value when the if for count > 1 is true.
Nice hack, transformed it into a string with the % sign 🙂
Thank you
Thank you, for number precision it is working fine, but the value is displayed black. I want to get colored values accordingly e.g: 0%-40% green, 40%-80% blue etc . Is it possible?
Can you help me with it.
Sorry misunderstood your question. I will remove the answer so that the question stays back as unanswered.
Interesting question. I don't know myself. Hopefully someone here can.
But as an aside do you need (or have!) that level of precision? ie 1/100,000th
SLA numbers are usually up to 4 (or more) decimal places, and that's what the visualizations are for. I guess v1.1 in Splunk 6.2 used to leave integers as they were and round floats up to 4 decimal places as I didn't do any special treatment on rounding or whatnot.
It works the way it is, but it was nicer before.
Fair enough. 6 nines is pretty full on though. 84 ms a day of downtime!