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!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...