Splunk Search

Group field value and count rather than overall count

emamedov
Explorer

eventtype="product-view"|stats count list(productname) as Products by username firmname

The above is the search string that I'm using and I receive the following results:

alt text

Instead of listing an overall count of products, I would like to have a count for each individual product. Not sure how to edit the current string or add a nested stats string to accomplish the said task.

0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Try this

eventtype="product-view"|stats count by username firmname,productname | stats list(*) as * by username firmname

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

Try this

eventtype="product-view"|stats count by username firmname,productname | stats list(*) as * by username firmname

emamedov
Explorer

That did the trick! Thank you very much!

0 Karma

sundareshr
Legend

Try this..

eventtype="product-view"|stats count by productname
0 Karma

emamedov
Explorer

That doesn't specifically display the username and firmname though. Please see below:

http://imgur.com/UiTNvK5

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...