Package com.netflix.eventbus.filter.lang.infix

An infix notation based language for event filters.

See: Description

Package com.netflix.eventbus.filter.lang.infix Description

An infix notation based language for event filters. At a higher level, one creates an expression made out of multiple "predicate"s chained together using the AND and OR operators.

Predicate

A predicate by definition is an expression that results in a boolean value. There are multiple predicates available in the language which are described below. On top of these predicates one can also use comparison functions, described below, which results in a boolean value.
Between Predicate:
A between predicate checks whether a value is between a lower and upper bound.
Example: "xpath("//a/b/c") between (100,150)". Here xpath() is a function which is described below. This is only supported for numeric inputs.
In Predicate:
An in predicate checks whether a value is in a list of values provided to the function. This is supported for alphanumeric inputs.
Example: "xpath("//a/b/c") in ("x", "y", "z")". Here xpath() is a function which is described below.
Null Predicate:
A null predicate checks whether the passed value is null.
Example: "xpath("//a/b/c") is null". Here xpath() is a function which is described below.
Regex Predicate:
A null predicate checks whether the passed value matches a provided regex.
Example: "xpath("//a/b/c") =~ """. Here xpath() is a function which is described below.
Exists Predicate:
A null predicate checks whether the passed value matches a provided regex.
Example: "xpath("//a/b/c") =~ "
"". Here xpath() is a function which is described below.
Comparison Functions
This language currently supports the following comparison functions:
  • Equals:
    Example: "xpath("//a/b/c") = "xyz". Here xpath() is a function which is described below.
  • Not Equals:
    Example: "xpath("//a/b/c") != "xyz". Here xpath() is a function which is described below.
  • Greater than
    Example: "xpath("//a/b/c") > "xyz". Here xpath() is a function which is described below.
  • Greater than or equals
    Example: "xpath("//a/b/c") >= "xyz". Here xpath() is a function which is described below.
  • Lesser than
    Example: "xpath("//a/b/c") < "xyz". Here xpath() is a function which is described below.
  • Lesser than or equals
    Example: "xpath("//a/b/c") <= "xyz". Here xpath() is a function which is described below.
All the above comparison functions are available only for numeric inputs.
XPath function
This primarily is the only function that fetches runtime values in the filters. The XPath will be run on the event object for which the filter is applied. For details about the evaluation and support
see this
Other value functions
We also have certain functions that helps convert values in specific formats. These functions are listed below: