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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...