You can use both like and match functions with eval command to
like(FIELD, PATTERN)
This function returns TRUE if FIELD values matches the PATTERN.
In PATTERN, you can use use the percent ( % ) symbol as a wildcard for multiple characters and use the underscore ( _ ) character for a single character match.
match(FIELD, "REGEX")
This is is regex based function and returns TRUE or FALSE based on whether REGEX matches FIELD values.
So both queries below returns same results:
| makeresults | eval printer ="Canon MF4770n (from WING_000.0.000.0-RCA)" | eval channel = if(match(printer, "WING.*RCA"), "Remote Print", "Office Print")
.
| makeresults | eval printer ="Canon MF4770n (from WING_000.0.000.0-RCA)" | eval channel = if(like(printer, "%WING%RCA%"), "Remote Print", "Office Print")
... View more