Splunk Search

Combine two stats count

cloud_cloud
Explorer

How to combine these two stats count into one?

... | stats count by operation

operation       count
added gid       3
deleted gid     2

... | stats count by gid

gid       count
10616     1
12757     1
16605     1
20458     1
22258     1

And I want these results:

operation     gid
added gid     10616
              12757
              20458
deleted gid   16605
              22258
Tags (1)
0 Karma
1 Solution

MuS
SplunkTrust
SplunkTrust

hi cloud_cloud

try

 | stats operation count by gid

cheers

View solution in original post

MuS
SplunkTrust
SplunkTrust

hi cloud_cloud

try

 | stats operation count by gid

cheers

cloud_cloud
Explorer

I've got Error in 'stats' command: The argument 'operation' is invalid.

But, after research on your answers I figured out correct command exactly what do I need! It's:
| stats values(gid) by operation

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