Splunk Search

How to get the sum of multiple rows based on a different column?

dwear
Explorer

I have a CSV with 3 columns; Username, AD group, Logins (Logins being total number of logins for that user). I want to sum the number of total logins per Active Directory group. I started with:

|stats(count) by group

But that just gives me the number of times each group appears in the CSV (which generally equals the number of users in that group). How do I make it sum Logins per AD Group?

Any help is appreciated.

0 Karma
1 Solution

somesoni2
Revered Legend

Use this. Your question describe the solution

How do I make it sum Logins per AD Group?

your base search | stats sum(Logins) as count by group

View solution in original post

0 Karma

somesoni2
Revered Legend

Use this. Your question describe the solution

How do I make it sum Logins per AD Group?

your base search | stats sum(Logins) as count by group
0 Karma

dwear
Explorer

Thanks. The "as count" is what I was missing I guess.

0 Karma
Get Updates on the Splunk Community!

Splunk Answers Content Calendar, June Edition

Get ready for this week’s post dedicated to Splunk Dashboards! We're celebrating the power of community by ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...