Splunk Search

How to create a table that indicates a column with the sourcetype?

greentomatoes
Engager

Hi everyone,

I am currently trying to create a table that shows the count of activity by user as well as the occurrence in which sourcetype: 

What I am trying to achieve

UsersSourcetypeCount
User 1source 120
User 2source 230


Here is my base search at the moment:

index=index* "user"="user1*" OR "user"="user2*" | stats count by user | eval input_type="Count"| xyseries input_type count

Right now, it does show me the count of the user activity but I'm not sure how to add the sourcetype to the search to create a table view.

Labels (4)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Just add "sourcetype" to the stats command.

index=index* "user"="user1*" OR "user"="user2*" 
| stats count by user, sourcetype

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Just add "sourcetype" to the stats command.

index=index* "user"="user1*" OR "user"="user2*" 
| stats count by user, sourcetype

 

---
If this reply helps you, Karma would be appreciated.

greentomatoes
Engager

Thank you! I didn't realize how simple the solution was haha

Get Updates on the Splunk Community!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...