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!

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...