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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...