contains()
Returns whether the target string contains a specific substring.
Syntax
contains(STR_EXPR, SEARCH_STR)
Required Parameter
STR_EXPR
- String expression.
SEARCH_STR
- String to be checked if it is included in the string value of STR_EXPR.
Usage
json "{}" | eval isInclude=contains("foo", "o") => true
json "{}" | eval isInclude=contains("bar", "o") => false
json "{}" | eval isInclude=contains("baz", null) => false
json "{}" | eval isInclude=contains(null, null) => false