Splunk Search

How to compare GeoLocation values of login events for each user to previous logins?

olawalePS
Path Finder

I am trying to create an alert that triggers when the location field of a login event from a user changes. so if a user logged in from London earlier and then the next login comes from Dublin, I want an alert to trigger. The login event has a username and client.geoLocation.city field.

Labels (2)
Tags (1)
0 Karma
1 Solution

yuanliu
SplunkTrust
SplunkTrust

Assuming your search window is applicable for this kind of alert, you only need to count number of different client.geoLocation.city.  Is this correct?  Something like

| stats values(eval('client.geoLocation.city')) as geoLocations by username
| where mvcount(geoLocations) > 1

View solution in original post

yuanliu
SplunkTrust
SplunkTrust

Assuming your search window is applicable for this kind of alert, you only need to count number of different client.geoLocation.city.  Is this correct?  Something like

| stats values(eval('client.geoLocation.city')) as geoLocations by username
| where mvcount(geoLocations) > 1
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...