Splunk Search

How search and list the same session ID's occurring in two or more hosts?

pavanae
Builder

Hi

I have fields created for both sessionId and host. Now I wanna find out the same sessionId happening in two different hosts and list them:

search: index="atg" sessionId="*mob" host="*"

sessionId example =16E4E8BA9480F388B11B3FC35B07732E.svcldprdapp06b-33mob

0 Karma
1 Solution

somesoni2
Revered Legend

Try something like this

index="atg" sessionId="*mob" host="*" | stats dc(host) as hostCount values(host) as hosts by sessionId | where hostCount>=2

View solution in original post

ermanoj21yadav
Explorer

What if I want to plot it on a graph on timechart like how many sessionIds had more than 1 hosts over a specific period of time

0 Karma

somesoni2
Revered Legend

Try something like this

index="atg" sessionId="*mob" host="*" | stats dc(host) as hostCount values(host) as hosts by sessionId | where hostCount>=2

pavanae
Builder

Thanks worked great

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...