Splunk Search

Calculations on search results

motzgogh
Engager

I am a complete splunk newbie and I'm trying to find information on how powerful the searches and reports can be.
Let's say I have a log of sourcetype transactions (with extracted fields account_number and amount). Can I write a search that calculate the current balance on all accounts by first finding all unique accounts and then adding all associated amounts?

Tags (2)
0 Karma
1 Solution

ziegfried
Influencer

Yup.

sourcetype=my_transactions account_number=* | stats sum(amount) as amount by account_number

View solution in original post

ziegfried
Influencer

Yup.

sourcetype=my_transactions account_number=* | stats sum(amount) as amount by account_number
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

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