Splunk Search

Find missing ids from two searches using stats not set

bowesmana
SplunkTrust
SplunkTrust

I have an index with two 'transaction types'. Create and Offer. For each create, I get an ID and I want to find out all created Ids that do not get an offer. I am making multiple 'Offer' requests, so there can be more than one Offer row for each i_bid. I can do it with set diff using

| set diff 
[ search index=web_load sourcetype=instrument i_tx=Create | stats count by i_bid | table i_bid ]
[ search index=web_load sourcetype=instrument i_tx=Offer i_status=0 | stats count by i_bid | table i_bid ]
| table i_bid

and I get a table with the created ids from search (Create) that do not have an offer in search 2.

However, I'd like to get this using stats if possible for efficiency as there will be hundreds of thousands of Create operations and set subsearches are limited to the default 10,000.

I can create tables of i_bid and i_tx using

index=web_load sourcetype=instrument i_status=0 i_tx=Create OR i_tx=Offer
| stats count by i_tx, i_bid

so, feel it ought to be possible to remove common i_bid

0 Karma
1 Solution

sundareshr
Legend

Try this

.... | chart count over i_bid by i_tx | where Offer=0

View solution in original post

0 Karma

sundareshr
Legend

Try this

.... | chart count over i_bid by i_tx | where Offer=0
0 Karma

bowesmana
SplunkTrust
SplunkTrust

I got to this

| stats count by i_bid | where count=1

which worked, but yours does to, thanks a lot.

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!

Observability Simplified: Combining User Experience, Application Performance & ...

Tech Talk Observability Simplified: Combining User Experience, Application Performance & Network ...

Event Series May & June: From Network Visibility to Service Intelligence

Unifying the Network: Moving from Alert Noise to Service Intelligence with Splunk ITSI In today’s hybrid ...

Global Splunk User Group Events: May + June 2026

Your Splunk Community Awaits: Discover Upcoming User Group Events Worldwide    Staying ahead in the fast-paced ...