I had to deal with this today - more in the context of "what was added or dropped between multivalue (MV) field A and MV field B", but the solution also lets you find the intersection between two MV fields. This approach avoids the expensive mvexpand command. The trick is to use mvmap() to do an operation on each value of one of the values in the MV field, and test to see if that value is in the other MV field. Technically, mvfind() takes a regex, so be careful with MV field values with regex-special characters in them. Here's an example: | makeresults | eval A="a, b, c", B="z, c, e, d" | makemv delim=", " A | makemv delim=", " B | eval ``` loop through each value of B. if the value is not found in A, add the value to a resulting mv field returned. ``` added=mvmap(B, if(isnull(mvfind(A, B)), B, null())), ``` loop through each value of A. if the value is not found in B, add the value to a resulting mv field returned. ``` removed=mvmap(A, if(isnull(mvfind(B, A)), A, null())), ``` loop through each value of A. if the value IS found in B, add the value to a resulting mv field returned. ``` same=mvmap(A, if(isnotnull(mvfind(B, A)), A, null))
... View more