Splunk Search

How to get sum for unique field values?

xvxt006
Contributor

Hi,

I saw that there is dc so we can get the distinct count but what if I want to get the sum for unique field values? I have tried something like this but it is missing some values. Any suggestions?

base search | dedup field | stats sum(field) as sum

s2_splunk
Splunk Employee
Splunk Employee

Is this what you mean?

base search | stats sum(value) as sum by field

Some example data would help, if that's not what you needed.

xvxt006
Contributor

Hi Thanks for checking. I have figured out this.

0 Karma
Get Updates on the Splunk Community!

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

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...