Splunk Search

How to match two sources and output anything that does not correlate or match up.

kgreat
Path Finder

Hi I have two csv files each listing a list of users and their status (Active or Disabled). I would like to correlate and match all Active users on email address and then output any users that don't match. The purpose of this exercise is to find any orphaned or unknown accounts within an application.

Source A (Lists All users from the directory and their status)
Field Names:
emailaddress (unique identifier)
User Status (with values either Active or Disabled)
First Name
Last Name

Source B (Lists all users found maintained in an application)
emailaddress (unique identifier)
First Name
Last Name

Tags (2)
0 Karma

chimell
Motivator

Hi kgreat
Try this search code

| set union [search SourceA   UserStatus="Active"|where isnull(emailaddress)  | fields firstName  lastName] [search SourceB  UserStatus="Active" |where isnull(emailaddress)  | fields firstName  lastName]

Tell me if it satisfy you

0 Karma

btt
Path Finder

Hi,
I'm not sure that i really understand your need but, in this query i first have all emailaddress in my two sources and then discard all those who are active.

sourceA | join emailaddress [search sourceB ] NOT [sourceA  Userstatus=Active |join [search sourceB Userstatus=Active] |fields emailaddress] |table emailaddress FirstName LastName
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...