Skip to content
Load Balancing
Visit Load Balancing on GitHub
Set theme to dark (⇧+D)

Supported fields and operators

The fields available for load balancing rules depend on whether Cloudflare proxies the traffic going through your load balancer.

If you use the wrong type of fields, you might see unexpected behavior from load balancing rules. For best results, always use the fields associated with your traffic's proxy status.

select load balancer fields based on the proxy status header

Fields supported regardless of proxy

Regardless of whether your traffic is proxied, you have access to the following fields:

Name in Expression BuilderFieldDescription
IP addressip.src
IP address

The client TCP IP address, which may be adjusted to reflect the actual address of the client by using HTTP headers such asX-Forwarded-For or X-Real-IP.

Example value:
192.0.2.1

Load Balancer Regioncf.load_balancer.region
bytes

The region name of the data center processing the request.

Load Balancer Namecf.load_balancer.name
bytes

The name of the load balancer executing these rules.

Example value:
lb.example.com

Proxied traffic

If your traffic is proxied, you have access to all the fields listed under Proxied Only and Both, such as:

  • Request Method
  • URI
  • Timestamp
  • Header

For the most up to date list of these fields, create a load balancing rule in the UI.

For more details about the field type or properties, refer to the Rules language documentation.

Unproxied traffic

If your traffic is not proxied through Cloudflare, you have access to all the fields listed under Unproxied only and Both.

Cloudflare Load Balancers support the following unproxied fields:

Name in Expression BuilderFieldDescription
Query Typedns.qry.type
Int

The numeric value of the DNS query type

Example Values:

  • 1 (A record)
  • 28 (AAAA record)
Questiondns.qry.typ
boolean

A boolean indicating that the received DNS message was a question

Query Namedns.qry.name
Bytes

The byte of the query name asked, such as example.com

Query Name Lengthdns.qry.name.len
Int

The length in bytes of the query name.


Operators and grouping symbols

  • Comparison operators specify how values defined in an expression must relate to the actual HTTP request value for the expression to return true.

  • Logical operators combine two expressions to form a compound expression and use order of precedence to determine how an expression is evaluated.

  • Grouping symbols allow you to organize expressions, enforce operator precedence, and nest expressions.

For examples and usage, refer to Operators and grouping symbols in the Rules language documentation.