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 Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...