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!

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 ...