As @richgalloway says, "IN" functionality is different between the "search" command and the "where" command. The search is | search username IN ("A","B","C") The where command is | where in(username, "A", "B", "C") and these are both string matches. Note that the search command will interpret \ so you will need to escape \ as \\ but oddly enough, not in the where command. I am not quite sure the purpose of this statement | stats count AS Total_Connections, latest(_time) AS Latest_Timestamp, values(identity) AS Security_Mapping, values(host) AS Connected_Hosts, values(username) as LanID by username because there is no point in doing values(username) as LanID because that will simply contain the same value as username because you are splitting by username. So, you could do this before the stats | where !in(username, "NAM\OT00564", "NAM\CHawki5")
OR
| search username NOT IN ("NAM\\OT00564", "NAM\\CHawki5") and then you want username to be LanID, so just do | rename username as LanID
... View more