Splunk Search

Is there a way to do calculation on streamstats values?

yma8000
New Member

Hi folks, newbie here, trying to use Splunk to do some stuff...

I have a search that ends like below:

| table DaysSinceLastAccess Good IdealbutUnlikely NotGood Actual
| sort by num(DaysSinceLastAccess)
| streamstats sum(Actual) as ActualCumulative

So has the stats as:

alt text

I would like to calculate the total on column Actual, via addcoltotals? then divide each row by this total.

How can I achieve this?

0 Karma
1 Solution

pradeepkumarg
Influencer

Append below to your search

 | eventstats sum(Actual) as Total | eval yourNewField = ActualCumulative/Total 

View solution in original post

pradeepkumarg
Influencer

Append below to your search

 | eventstats sum(Actual) as Total | eval yourNewField = ActualCumulative/Total 

yma8000
New Member

thanks! exactly what i wanted.

0 Karma
Get Updates on the Splunk Community!

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 ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...