Splunk Search

Return results when value of one field is not equal to value of another field

jumper4000
Explorer

Hi, I'm trying to create a search where the value of one field is not equal to value of another field. For example I have these events -

EventCode=5555
UsernameA=Jack
UsernameB=Bob

EventCode=555
UserNameA=Steve
UserNameB=Steve

My goal is to only show the result when UsernameA and UsernameB are different. Does anyone how to do this?

Thanks

Tags (1)

gkanapathy
Splunk Employee
Splunk Employee

There is no efficient way to do this in Splunk, but pretty much you need:

EventCode=whatever sourcetype=mysourcetype UserNameA=* UserNameB=* | where UserNameA!=UserNameB

this will work, but won't run terribly quickly.

Get Updates on the Splunk Community!

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

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...