Splunk Search

Adding Field Values Generated by a |stats latest(fieldvalue) command

jason_hotchkiss
Communicator

Hello -

 

I have the following search:

<base search>
| fields host registrations
| stats latest(registrations) by host

This produces the following table:

host       latest(registrations)
Pc1        51

Pc2        29

Pc3        18

How would I add the values of latest(registrations) to provide a single value for all 3 hosts?  For example, I would like only the sum of the latest registrations (98) to display in a single value panel.

 

Thank you!

Labels (3)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
<base search>
| fields host registrations
| stats latest(registrations) as latest_reg by host
| stats sum(latest_reg) as total_latest_reg

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
<base search>
| fields host registrations
| stats latest(registrations) as latest_reg by host
| stats sum(latest_reg) as total_latest_reg
0 Karma

jason_hotchkiss
Communicator

Thank you!!  This worked for me.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...