Closed
Description
Currently EQL supports the following pattern for doing wildcard comparisons:
field == "wild*card"
which translates to wildcard(field, "wild*card")
.
That is making a comparison (==
or !=
) to a string that contains *
translates to a wildcard check.
This is convenient however it has a few side-effects:
- one cannot make a comparison to a string containing
*
. - the comparison/wildcard inherits the semantics of equals such as case-insensitivity.
- makes it hard to reason whether an expression is string equality or wildcard comparison:
foo == concat("wild", "*", "card")
- for more than one pattern, the pattern ends up being more verbose:
foo == "wild*" or foo == "*card"
vswildcard(foo, "wild*", "*card")
It would be good to get some numbers to see how often this pattern is being used.
My proposal is to deprecate/remove this syntactic sugar and promote explicit use of wildcard
for clear semantics and clarity in intent.