Alerting

Detect IP Address Change Alert

byronhowell
New Member

Basically what I need to do is compare a user's authentication request to their most recent session start request and alert when they are different.

Example -
example@email.com sessions started with IP 12.145.123.
example@email.com authentication request IP 12.145.123
example@email.com authentication request with IP 58.145.12.125

I would want to see that authentication request as an alert.

Labels (1)
0 Karma

to4kawa
Ultra Champion
index=yours sourcetype=yours
| rex "(?<email>[\w.\-]+@[\w.\-]+)"
| rex "(?<msg>sessions started with IP|authentication request with IP)"
| rex "(?<ip>\d+\.\d+\.\d+\.\d+)"
| stats min(_time) as firstTime max(_time) as lastTime dc(msg) as auth dc(ip) as flag values(ip) as ip by email
| where flag > 1
| convert ctime(firstTime) ctime(lastTime)

Three rex extract the fields from event. you should fix it .
Email with different ip is malicious, so these display by where flag >1

richgalloway
SplunkTrust
SplunkTrust

Perhaps this will help.

index=foo "authentication request with IP" NOT [ search index=foo "session started with IP" | head 1 | fields ip_address | format ]
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...