Specifications
General Match Expressions and Match Bodies
Equalizer Installation and Administration Guide 125
If the match expression evaluates to false, then each subsequent match rule in the list of match rules
for the virtual cluster is processed until a match occurs. All virtual clusters have a Default Match
rule, which always evaluates to true and which will use the entire set of servers for load balancing.
The Default Match rule is always processed last.
Each virtual cluster can have any number of match rules, and each match rule can have arbitrarily
complex match expressions. Keep in mind that Equalizer interprets match rules for every Layer 7
cluster connection, so it is a good idea to keep match rules as simple as possible.
General Match Expressions and Match Bodies
A match rule consists of a match expression and a match body, which identifies the operations to
perform if the expression is satisfied by the request. Match syntax is as follows:
match name { expression } then { body }
Each match has a name, which is simply a label. The name must follow the same restrictions as
those for cluster names and server names. All match names within a cluster must be unique.
Match Expressions
Match expressions affect the subsequent processing of the request stream using URI, host, or other
information. Match expressions are made up of match functions, most of which are protocol-
specific, joined by logical operators, optionally preceded by the negation operator, with sets of
beginning and end parentheses for grouping where required. This may sound complex, and it can
be, but typical match expressions are simple; it is usually best from a performance perspective to
keep them simple.
The most simple match expression is one made up solely of a single match function. The truth value
(true or false) of this expression is then returned by the match function. For example, a match
function common to all Layer 7 protocols is the any() function, which always returns true,
independent of the contents of the request data. So, the most simple match expression is:
any()
which will always result in the match rule being selected.
Use the logical NOT operator, (sometimes), to invert the sense of the truth value of the expression.
So, you can use the NOT operator to logically invert a match expression, as follows:
NOT expression
giving rise to the next simplest example:
NOT any()
which always evaluates to false and always results in the match rule not being selected.
Note – Multiple requests may be received on the same TCP/IP connection. The default behavior
of Equalizer is to load balance based only on the contents of the first request on a connection.
This is indicated by the once only cluster flag, which is enabled by default (if this flag is not
visible in the cluster flags, turn on the advanced flag).
When using Match Rules, it is usually desriable to turn off the once only flag so that Equalizer
matches against each individual request on the stream, not just the initial one.