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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...