Splunk Search

How to aggregate percentage information in pie chart labels?

snemiro_514
Path Finder

I would like to aggregate the % info in the pie labels, so it will read:

"OK (77%)" instead of OK
"ERRORS (23%)" instead of ERRORS

Is there any straightforward way to do it?

1 Solution

martin_mueller
SplunkTrust
SplunkTrust

I don't know of a way. I believe the percentage is calculated within the charting JS, so you're not going to achieve anything within the search... and I don't see any setting to configure the rounding behaviour. The browser locale seems to be passed to the percentage formatting code, but I don't see how that would have a lot of sway over the number of decimal points. Additionally, changing the locale for this would probably cause more issues elsewhere than would be solved here.

0 Karma

snemiro_514
Path Finder

Any way to round the % ? It's showing 3 decimal places and I would like to chop them.... something like| eval internalperc=round(internalperc,0)

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

maffreitas
Path Finder

Hi @martin_mueller, do you know if can we show de value inside the slice?

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

You should ask this as a new question. Not only will you get the attention a new question deserves and not pollute two-year-old other questions with varying potentially version-specific info, but also make it easier for others to find what they need.

Off the top of my head I don't think the built-in pie charts have an option to move the labels to the inside of the pie, but you're always free to build a custom visualization and publish that as an app on splunkbase 🙂

jackpal
Path Finder

Sorry for the dumb question but where is this file that needs to be modified ?

0 Karma

balazsg
New Member

Check Edit Source when you are in a Dashboard.
paste
<option name="charting.chart.showPercent"> 1</option>

0 Karma

snemiro_514
Path Finder

Great! tks.

0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...