Splunk Search

How can I calculate Percentage for multiple fields?

punithsj96
Explorer

I am trying to get percentage value fields for multiple fields by time, and fields are dynamic. How can I calculate? 

search | eval Duration=tostring(round(TimeDiff1), "duration")
| chart count over TimeDiff1 by MaterialNumber
| chart sum(*) as * by TimeDiff1 span=300 

my result is:

TimeDiff1KM50115007V002KM51585489V000KM51585490V000KM51585494V000
0-30024020
300-6000100
600-9000701
900-12000000
1200-15000004
1500-18000000
1800-21000000
2100-24000001

 

But, I want result in below format. 

TimeDiff1KM50115007V002KM51585489V000KM51585490V000KM51585494V000perc(KM50115007V002)perc(KM51585489V000)perc(KM51585490V000)perc(KM51585494V000)
0-3002402010001000
300-6000100012.500
600-9000701087.5016.66666667
900-120000000000
1200-1500000400066.66666667
1500-180000000000
1800-210000000000
2100-2400000100016.66666667

 

Labels (1)
0 Karma

SanjayReddy
SplunkTrust
SplunkTrust

Hi @punithsj96 

if you can share sample qurey and exepcetd output we can help you furthur

0 Karma

punithsj96
Explorer

Hi @SanjayReddy ,

I am attaching pic for you reference. Expected out should come in this form. 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @punithsj96,

share your data or searches as text, never as screenshot!

Anyway, can you share your search?

Ciao.

Giuseppe

0 Karma

punithsj96
Explorer

Hi @gcusello , 

I just updated the question, please kindly check the post. 

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...