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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...