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!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...