Dashboards & Visualizations

How to customize pie chart total value with nested data?

V21MGharib
Explorer

Hello,

I'm a newbie in splunk and I'd like to draw a pie chart where the total value is taken from a csv sheet.

e.g. X = 2 & Y = 10 and I'd like the pie chart total to take the value of (Y) and (X) to be part of it with its percentage. So, total pie chart value is 100% where the 100% represents the $value of Y and X represents 20% of it.

The best query I reached is (index="A" source="*B*"  | chart values(X) over Y | transpose) however the chart represents the percentage of X & Y as if the total value of the pie chart is (X+Y) which is not the case I want.

Labels (4)
0 Karma
1 Solution

kamlesh_vaghela
SplunkTrust
SplunkTrust

@V21MGharib 

Here you can do some tricks to get the value of the remaining field (assume Z) and work with this Z field to represent data.

Like, this

| makeresults
| eval X=2,Y=10 
| eval Z=Y-X
| chart values(X) over Z | transpose

 

Here we are getting Z from the total value(Y) minus field value(X).

Screenshot 2022-09-27 at 11.00.16 AM.png

 

I hope this will help you.

Thanks
KV
If any of my replies help you to solve the problem Or gain knowledge, an upvote would be appreciated.

 

 

View solution in original post

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@V21MGharib 

Here you can do some tricks to get the value of the remaining field (assume Z) and work with this Z field to represent data.

Like, this

| makeresults
| eval X=2,Y=10 
| eval Z=Y-X
| chart values(X) over Z | transpose

 

Here we are getting Z from the total value(Y) minus field value(X).

Screenshot 2022-09-27 at 11.00.16 AM.png

 

I hope this will help you.

Thanks
KV
If any of my replies help you to solve the problem Or gain knowledge, an upvote would be appreciated.

 

 

0 Karma

V21MGharib
Explorer

That's what I've done exactly. I couldn't find any other way.

Thank You.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...