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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...