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!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...