Splunk Search

How to compare string values between two fields and only return results from the search that do not match?

kharma
New Member

So I currently have Windows event log (security) files and am attempting to compare two strings that are pulled out via the rex command (lets call them "oldlogin" and "newlogin")

Values of each variable are as follows:

oldlogin = ad.user.name
newlogin = user.name

What I am trying to do is to compare oldlogin and newlogin, and if they are both the same (minus the "ad.), then don't return them.

Unfortunately, I am rather new to Splunk and am not familiar with how to do this, so I will try to provide as much data as possible upon request.

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Perhaps something like this will help.

<your search> | eval matchname="ad.".newlogin | where oldlogin<>matchname | ...
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Perhaps something like this will help.

<your search> | eval matchname="ad.".newlogin | where oldlogin<>matchname | ...
---
If this reply helps you, Karma would be appreciated.

kharma
New Member

This worked perfectly thank you. I didn't realize that eval allowed you to do string additions.

0 Karma

MuS
SplunkTrust
SplunkTrust
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

How to find the worst searches in your Splunk environment and how to fix them

Everyone knows Splunk is a powerful platform for running searches and doing data analytics. Your ...

Share Your Feedback: On Admin Config Service (ACS)!

Help Us Build a Better Admin Config Service Experience (ACS)   We Want Your Feedback on Admin Config Service ...