Splunk Search

How to find common field values in different action?

navan1
Explorer

Hello All,

I want to create an alert to find certain actions done by users from same Index.

Index= myindex

sourcetype= mysourcetype

action = "session Start" and action=user added

Note : From the above actions, the common field are "SessionID"  and user information is only in action=user added.


 How to find who started the session based on time? 
|table sessionID user src_host  src_ip _time

Labels (6)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @navan1 ,

if the fields are the ones you described it's a simple search:

index= myindex sourcetype= mysourcetype (action = "session Start" OR action="user added")
| stats 
   dc_action) AS action_count 
   values(action) AS action
   values(user) AS user
   values(src_host) AS src_host
   values(src_ip) AS src_ip
   earliest(_time) AS _time
   BY SessionID
| where action_count>1
| table sessionID user src_host src_ip _time

Ciao.

Giuseppe

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| stats list(user) as user list(src_host) as src_host list(src_ip) as src_ip list(_time) as _time by sessionID 
0 Karma

navan1
Explorer

If I am using below query the time format is not coming in human readable format. See below,

| stats list(user) as user list(src_host) as src_host list(src_ip) as src_ip list(_time) as _time by sessionID

 

1688126033
1688125889
1688125889

And is there any way to print the actions separately?
Tags (1)
0 Karma

dural_yyz
Motivator
| convert ctime(_time) as Time
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 ...