Splunk Search

Summing the row

vinay_ks04
New Member

Colum A Column B
1 1
2 2
2 3
2 4
5 5

I wanted to sum columnB but on condition. Below is the example

(Column A) - 1 (Sum of Column B) 1
(Column A) - 2 (Sum of Column B) 2 + 3 + 4 = 9

Tags (2)
0 Karma

gfuente
Motivator

Hello

I think you can use eventstats like:

...| eventstats sum(ColumnB) as Total by ColumnA | ...

Try it and let me know

Regards

0 Karma

gfuente
Motivator

The same but with both fields in the by:
...| eventstats sum(ColumnB) as Total by Site, ConfigID | ...

0 Karma

vinay_ks04
New Member

Hi,

I have used for my another column.

there are three columns

Site ConfigID TaskCount
BAN 1 1
2 2
3 4
5 5
MYS 1 1
1 2
3 4
4 5
4 6

I have used your menthod for consolidating with site wise.
Kindly let me know for summing of taskcounts of same configids.

0 Karma
Get Updates on the Splunk Community!

AI for AppInspect

We’re excited to announce two new updates to AppInspect designed to save you time and make the app approval ...

App Platform's 2025 Year in Review: A Year of Innovation, Growth, and Community

As we step into 2026, it’s the perfect moment to reflect on what an extraordinary year 2025 was for the Splunk ...

Operationalizing Entity Risk Score with Enterprise Security 8.3+

Overview Enterprise Security 8.3 introduces a powerful new feature called “Entity Risk Scoring” (ERS) for ...