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!

Introducing the Splunk Community Dashboard Challenge!

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

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...