To be precise, the 50k rows limit applies to the join command. The general subsearch limit is just 10k restults. (and you have time limits for subsearch execution). And about the original question - if you have a search which returns inconsistent results, unless it contains an element of randomness, it means it hits some limits and is finalized in different moments and needs reworking. In this case, as @gcusello already pointed out, you're using the join operation which is generally strongly advised against. There are some specific use cases for it but it's best avoided in a typical case. The easiest approach to your search would be probably to reverse the order of operations - do a search and apply the lookup. The upside of this is that such search can be relatively well parallelized and the lookup will be matching on indexers. The downside is that if the lookup is huge it will not be very fast since for csv-based lookups (and if the lookup gets distributed to indexer, you're dealing with a csv export even if the original lookup was kvstore-based) the match done by linear matching from the top of the file. It should still be faster than join anyway. So you should simply do something like index="maj_p" OnboardingStatus=Onboarded OSPlatform=windows1* | stats latest(OnboardingStatus) as OnboardingStatus, latest(SensorHealthState) as SensorHealthState, latest(OSPlatform) as OSPlatform, latest(ClientVersion) as ClientVersion, latest(_time) as Def_Lastseen by DeviceName | eval Week_breakdown=case(Def_Lastseen>=relative_time(now(), "-7d@d"), "1-7 days", Def_Lastseen>=relative_time(now(), "-15d@d") AND Def_Lastseen<relative_time(now(), "-7d"), "8-15 days") | eval nt_host=upper(replace(DeviceName, "\..*$", "")) | lookup workstations (you had an error here; you can't have an asterisk in lookup name) nt_host <possible OUTPUT something AS something rules> | where hostname!="*.corp" (dv_install_status IN ("In use", "In stock") OR ds="dal" OR (seen_by_obt="n/a" AND ds!="dal")) AND (seen_by_cs="Yes" OR seen_by_q="Yes" OR seen_by_sccm_status="Yes") AND (os="Windows" OR os="WINDOWS") Now there comes a part which I don't understand. You're doing | eventstats count as scope_count Which gives you a field with the same value across all results. And then you're doing | stats count as agent_count by scope_count I don't get it. You had an inner join so you can't have results which have a different scope_count value than the "main" one or don't have this value. Anyway, if you want to have the size of the lookup, you can do - for example | appendcols [ | inputlookup <...> | stats count as scope_count ] at the end to add this count. It's a fast operation so it should execute properly.
... View more