Splunk Search

Splunk query to combine two searches

anoopambli
Communicator

I haven't written a complex splunk query for a while, please help me in getting started with this. This is what i am trying to do,

I have a master list of hosts which i have loaded into Splunk. i want to compare that hosts with another list which i get by running a query in splunk. The outcome i am expecting is, Y if it is matching in both the list 'N' if it is there on the first list but not on the second.

Tags (3)
0 Karma

woodcock
Esteemed Legend

Like this:

<first search here> | dedup host | eval type=1 | append [search <second search here> | dedup host | eval type=2] | stats values(type) AS types dc(type) AS numTypes BY host | eval outcome=case(numTypes=2,"Y",type=1,"N",type=2, "?", 1==1,"??") |table host outcome
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!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...