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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...