Splunk Search

How to find all unmatched records in two sources type by using multiple fields?

oraclebox
Explorer

sourcetypes=ship
fields: PortId,ServiceLoopID,VesselName,ID
sourcetypes=route
fields: PORT,LOOP,VS_NAME,SID

I have two sourcetypes above, I want to find out all events in sourcetypes=ship which cannot find in sourcetypes=route.
The matching fields is PortId=PORT, ServiceLoopID=LOOP, VesselName=VS_NAME, ID=SID, how can I do it?

Tags (3)
0 Karma

somesoni2
Revered Legend

Try this

sourcetype=ship NOT [search sourcetype=route | table PORT,LOOP,VS_NAME,SID| rename PORT as PortId, Loop as ServiceLoopID, VS_NAME as VesselName, SID as ID ] | table PortId,ServiceLoopID,VesselName,ID
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 ...