Splunk Search

Search based on two searches where one field from one search subtracts results from the other search

seanburke101
New Member

So i have logs coming from two different applications. They both both track certain customer requests. They both have a unique id associated with different run throughs. The second app will have a subset of the first apps id's. What i want to do is make a table that has information about all the id's that are in the first search but not in the second. I can use the diff command to get all the unique id's but that only works when i have the same row format in each table. I want other information other than the id's the the second search does not track. Here's my diff search.

| set diff [search tag=app1| dedup mdc.id| rename mdc.id AS "Unique Id" | table "Unique Id"] [search app=app2 | dedup artifacts.tracker.id| rename artifacts.tracker.id AS "Unique Id" | table "Unique Id"]

Thanks for any help you can give.

0 Karma

ChrisCLewis
Communicator

Good afternoon,

You could try using |outputlookup.... the Id's from the first search, then appendpipe the second half with a NOT [|inputlookup .... ]
This would cause the second search to ignore the Id's from the first.

I'm sure someone else will provide a more efficient / quicker way but this should work

Regards

0 Karma
Get Updates on the Splunk Community!

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to Officially Supported Splunk ...