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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...