Hi @USA69 , I cannot test the search, so, see my approach and apply it to your search: 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, "\..*$", ""))
| append [
| inputlookup workstation* 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")
| eventstats count as scope_count ]
| stats values(*) AS * BY nt_host
| eval nt_host=upper(replace(DeviceName, "\..*$", ""))]
| search OnboardingStatus=*
| stats count as agent_count by scope_count
| eval missing_agents = scope_count - agent_count
| eval incompleteness = round((missing_agents/scope_count) * 100, 2)
| eval completeness = round((agent_count/scope_count) * 100, 2)" Ciao. Giuseppe
... View more