Splunk Search

Basic math operation applied to stats

JamesPineda
New Member

Hi all,

Student, new to Splunk and dbs.

I need some help performing basic math operation against stats results. I'd like to take the total of events in a single field/column, using 'stats count(field_name)', and then multiply this total by a percentage or some other fixed number.

Can anyone point me to the section of "Splunk for Real Dummies" that might provide me some guidance?

Any help would be appreciate. Reading in circles on this one...

Cheers,
James

Tags (2)
0 Karma
1 Solution

micahkemp
Champion

You can always perform operations after stats:

| stats count(field_name) AS field_name_count | eval field_name_result=field_name_count*<some constant>

View solution in original post

0 Karma

micahkemp
Champion

You can always perform operations after stats:

| stats count(field_name) AS field_name_count | eval field_name_result=field_name_count*<some constant>

0 Karma

JamesPineda
New Member

Thanks Micah!

I really appreciate your lightning-fast, concise, and illuminating response.

It worked like a charm (after I removed the $ I initially used in the field.

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...