Splunk Search

How to find the events contain different fields while they have the same value in another field?

weikuanl
New Member

I got the following log events:

=====

User:A IP_address:10.0.0.1

User:B IP_address:10.0.0.2

User:C IP_address:10.0.0.3

User:A IP_address:20.1.1.1

User:C IP_address:10.0.0.3

=====

As shown above, event 1 and event 4 both have the value "A" in User field, but they got different values in "IP_address" field. What search command should I use to filter the logs and find out event pairs like event 1 and event 4 above (have the same value in User field but different values in IP_address field)? Thanks!

Tags (1)
0 Karma

ayme
Splunk Employee
Splunk Employee

sourcetype=your_sourcetype | stats values(IP_address) as ips by User | where mvcount(ips)>1

...should do the trick.

weikuanl
New Member

Thanks a lot, it works!

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

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 ...