source=*/thelog.log (stringVal1=0 AND stringVal2!=0) | stats count
Are you looking for a query to search for one string and ensure that other string is not found? If yes then try something like this
source=yoursource "string1Val" NOT "string2Val"