Capability

FX Expression and Variable Engine

One expression language drives rules, health checks, logs, GTM triggers, security and access decisions across every module.

The TR7 FX Expression and Variable Engine lets you use the same decision language across every module in the platform. Traffic rules, health checks, log templates, security policies, GTM triggers and ACL logic are all defined through a shared FX language — not through separate syntaxes for each module. The FX engine brings together 41 built-in functions, 173 variables and 14 variable groups covering traffic, user, connection, body, SSL, WAAP and AAM context under a single expression model. JSONQUERY, XMLQUERY, JWTPAYLOAD, PARAM, MAP, LIST, DIGEST, IPMASK and text transformation functions can all be composed in the same expression tree. Expression authoring is schema-driven: function arguments, variable scopes, usage contexts and types are validated before the rule is saved. Errors are caught during authoring — not while they are affecting production traffic. The result: TR7 makes it practical to manage complex traffic and security decisions through a single language, a single variable model and shared logic across all modules.

41
Built-in functions — from converters to JWT queries
173
Built-in variables — traffic and security context across 14 groups
6+
Modules sharing the same FX language: rules, health checks, logs, captcha, GTM, ACL

When every module has its own language, operational complexity grows with the platform.

Enterprise traffic management is no longer just load-balancing rules. Inside the same platform, traffic routing, health checking, log enrichment, GTM decisions, security scoring, captcha policy, ACL and access context all run together. The problem is that most products manage these modules with separate expression languages, separate variable names and separate error behaviors.

That fragmentation forces operators to switch mental context constantly. The same value is written differently in one module versus another — client country, source IP, request path, JWT claim or WAAP score are all handled by separate logic in each place. The result is higher learning cost, multiplied rule duplication and longer debug cycles.

More dangerous is when the same business rule is interpreted differently across modules. If the health-check condition diverges from the routing condition, the system can mark a service healthy while a separate logic path drops traffic to that same service. When the log side records the same context incompletely, post-incident investigation suffers as well.

The right approach is to make a single expression language the shared decision layer. That language should define functions, variables, type checking and usage scope centrally, so that every module consumes the same expression tree within its own operational context.

The TR7 FX Engine meets this need: it unifies decision logic scattered across modules under a single expression language, a single variable catalog and a pre-registration validation model.

Our approach

Instead of splitting decision logic into separate per-module syntaxes, TR7 compiles and evaluates everything through a shared FX expression tree.

Function and variable catalog defined centrally

The FX engine exposes 41 built-in functions and 173 variables organized in 14 groups. Connection, HTTP headers, body, SSL, timers, statistics, WAAP and AAM contexts are all selected from the same catalog.

Expressions compile to a native sample-fetch and converter chain

Functions that can be handled natively run directly as a high-performance sample-fetch and converter chain. For example, a JSON field from the request body can be read, normalized with a text transformer and bound to a single expression result.

Non-native functions compile to Lua actions

Functions requiring XML XPath, complex JWT queries or custom processing are emitted as Lua-based actions. The FX language stays unified; the runtime path is chosen based on what the function needs.

The same expression engine is consumed by every module

Traffic rules, health checks, log formats, GTM triggers, captcha policy and ACL all share the same function and variable model. This commonality reduces the need for operators to learn a new decision language for each module.

Capabilities

The FX Expression and Variable Engine turns platform-wide variables and functions into a schema-driven, validatable and compilable model.

173 variables across 14 groups cover traffic and security context

The FX variable catalog is organized into connection, HTTP headers, body, client, request line, response line, SSL, statistics, timer, tracking, WAAP, AAM, VarBuilder and other groups. Operators select source IP, destination port, request path, response status, SNI, certificate details, WAAP score, AAM user role or custom variables from the same model. This prevents the same context from being written under different names in different modules, making rule language more consistent, more readable and less error-prone.

41 functions span from text transformation to JSON and XML queries

The function catalog covers converter, math, XML, JSON, JWT, IP, string, hash, FIX, MQTT, map/list, parameter and conditional selection groups. JSONQUERY, XMLQUERY, JWTHEADER, JWTPAYLOAD, PARAM, DIGEST, LOWERCASE, STRREPLACEALL, MAP_STR, LIST_REG and TERNARY can all be composed within a single expression. Operators use the same FX model for simple text transformations and for deep body field queries alike, moving rule authoring away from ad-hoc coding toward manageable policy definition.

Native compile path is used for low-latency expressions

Variables and functions with native support compile directly into a sample-fetch and converter chain. This path is suited to frequently needed decisions such as header reads, path matching, text transformation, map lookups and certain body queries. Because no intermediate interpretation layer is involved, performance remains predictable. Traffic rules are translated to the platform's most efficient execution path whenever possible.

Lua compile path covers complex and custom functions

Controls that cannot be expressed through the native chain run as Lua actions. XML XPath queries, custom JWT checks and complex conditional processing are all supported this way. The expression language does not change from the operator's perspective — the system selects the correct execution path in the background. This separation combines a performant native path and a flexible Lua path in a single FX experience.

Type checking rejects invalid expressions before they are saved

Every function argument is defined with a type — integer, string, jsonPath, xmlPath, hash or smartInput. The UI and management layer validate these types at save time. Wrong argument type, missing parameter or incompatible nested usage is caught before reaching the runtime, reducing unexpected rule failures in production traffic.

Usage scope is filtered by module and context

Each variable carries metadata describing which modules, condition types and traffic phases it can be used in. Some variables are valid only in the response phase; others appear only in log templates or specific condition types. The UI uses this information to present context-appropriate options to the operator, preventing invalid variables from being placed in the wrong position.

VarBuilder lets operators create their own computed variables

The VarBuilder group enables operators to produce custom variables that are computed at runtime. A value is calculated through an FX expression, stored within the transaction scope and reused in subsequent rules. This model reduces the need to rewrite the same calculation in multiple places. In complex flows, decision logic becomes more modular and traceable.

Auto-complete is fed from schema data to speed up authoring

The FX console draws function, variable, argument and scope information from the central schema. As the operator types a function name or variable, the appropriate options are suggested; arguments that accept empty values and functions requiring parentheses are guided correctly by the UI. This reduces the learning curve for new users and allows experienced operators to author rules faster. Expressions become more correct before they even reach the save step.

Operational depth

The FX engine is designed with validation, scope enforcement, audit, performance and edge-case behavior in mind — not just the expression authoring experience.

01

Argument validation

The expected argument list and types for each function are kept in the central definition. Both the UI and the management layer check this information independently. As a result, invalid expressions are rejected not just on screen but also at the point of save.

02

Response phase scope

Some variables are meaningful only in the response phase. These variables are flagged in metadata and blocked from use in request-phase conditions. This distinction reduces runtime errors caused by phase mismatches.

03

Hidden variable aliases

Some variables are kept in the system for backward compatibility or internal use but are not exposed in the UI. This allows the platform to continue running older expressions while presenting operators with a clean and accurate variable list. The visible catalog and internal use are kept separate.

04

Lua converter loading

Functions such as XMLQUERY, XMLPATHTYPE and XMLPATHEXISTS depend on Lua converter components. These components are loaded when the service starts and are consumed by the relevant FX functions. Missing converter states should be caught during deployment and health-check processes.

05

Audit and versioning

Every expression tree should be traceable with a change history. Who changed which expression and when is critical information for operations and security reviews. These records provide rollback capability and accountability tracking, especially for rules that affect traffic behavior.

06

Regex performance warnings

STRREPLACEALL and certain regex-based checks can produce high processing cost if written carelessly. Backtracking-heavy patterns can pose both security and performance risks. The UI should warn operators in these cases and encourage safer pattern authoring.

When to use it

Shared expression in health checks and traffic rules

SaaS teams can use the same FX expression — such as `$.status == "OK"` in the response body — in both the health check and the traffic routing rule. Because the same service state is not written differently in each module, operational consistency improves.

Log enrichment with JWT claims

SOC teams can add user email address, role or tenant information to the log format via JWTPAYLOAD. Incident investigation goes beyond raw IP and URL data, making user context visible in every log entry.

Geo and ASN-based triggering in GTM decisions

Global service teams can evaluate country, ASN or latency data through FX expressions when selecting a DNS response. The same logic can be reused in a traffic routing rule whenever needed.

Hash-based controlled A/B routing

E-commerce teams can shift a defined percentage of traffic to a new variant based on a hash derived from the user identifier. Distribution is deterministic — the same user is always directed to the same experience on every request.

Frequently asked questions

How many functions and variables does the FX engine provide?
The FX engine includes 41 built-in functions and 173 variables. Functions are organized into converter, math, XML, JSON, JWT, IP, string, hash, FIX, MQTT, map/list, parameter and conditional selection groups. Variables are arranged across 14 groups including connection, HTTP headers, body, SSL, statistics, timers, WAAP, AAM and VarBuilder.
Which modules share the same FX expression language?
Traffic rules, health checks, log templates, GTM triggers, captcha policy and ACL all share the same FX function and variable model. This means operators do not need to learn a different syntax for each module, and the risk of inconsistency across module boundaries is significantly reduced.
How does pre-registration type checking work?
Every function argument is defined with a type — integer, string, jsonPath, xmlPath, hash or smartInput. The UI and management layer validate these types before the expression is saved. Wrong type, missing parameter or incompatible nested usage is rejected before it can reach the runtime.
What is the difference between the native compile path and the Lua path?
Variables and functions with native support compile directly into a sample-fetch and converter chain — ideal for header reads, path matching and common body queries. Functions such as XMLQUERY, custom JWT checks or complex conditional logic that cannot be expressed natively are emitted as Lua actions. From the operator's perspective the expression language is the same in both cases.
What can VarBuilder be used for?
The VarBuilder group lets operators define custom variables that are computed at runtime through FX expressions. The computed value is stored in the transaction scope and can be referenced directly in subsequent rules. This eliminates the need to rewrite the same calculation multiple times across different rules.
How is variable scope enforced?
Each variable carries metadata describing which modules, condition types and traffic phases it is valid in. Variables meaningful only in the response phase are not shown in request-side conditions. The UI uses this scope information to present context-appropriate choices to the operator and to prevent invalid variable placement.

Unify platform decisions in a single expression language

Manage traffic rules, health checks, logs, GTM and security decisions through the same FX model. Let's walk through a live setup in your own environment.