Splunk Search

How to sum 2 percent ?

mah
Builder

Hi,

I have a table like that : 

namepercent
AAA90
BBB

60

70

 

I want to group the BBB percent in one percent.

How I can do this command ? 

Thanks

Labels (1)
Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
-- your search
| streamstats count as row
| eventstats sum(percent) as total by row
| eval percent=round(total/mvcount(percent),2)
| fields - row total

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

How do you want to "group" them? Add them together, multiply them together, take an average, join them with a space/comma between?

0 Karma

mah
Builder

Sorry, I want to average them.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
-- your search
| streamstats count as row
| eventstats sum(percent) as total by row
| eval percent=round(total/mvcount(percent),2)
| fields - row total
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...