Splunk Search

Breakdown the Totals

kbohlken
Observer

I want to add more columns that will show the sessions.  Such as sudo su ssh etc.  Currently I have this:

index="name of index" user=*
| chart count by user, action
| sort user

Maybe I need two separate searches?  One for action=failure and another for action=success?  I'm trying to breakdown what the totals are for success and failures.  Specifically I'd like to know when ssh sudo and su are being used.

Labels (2)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

(This is a general forum for all Splunk data types.  It always helps to have input examples/illustrations.  For this specific question, it will also help to illustrate how you expect output to look like.)

Assuming your data includes user, action, and session, like 

_timeactionsessionuser
2021-05-20 19:09:39failbaruser2
2021-05-20 19:09:39failsudouser3
2021-05-20 19:09:39successsudouser1
2021-05-20 19:09:39successsudouser1
2021-05-20 19:09:39successbaruser3
2021-05-20 19:09:39successfoouser3
2021-05-20 19:09:39failbaruser1
...   

and you want something like

useractioncountsessions
user1fail2sudo
user1success4
bar
foo
sudo
user2fail2sudo
user2success5
bar
foo
sudo
user3fail4
bar
foo
sudo
user3success3
bar
foo
sudo

You can use

 

| stats count values(session) as sessions by user, action

 

 

0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...