Operators
An operator defines how a field is compared against a value in a condition: exact equality, list membership, or a substring search? Every condition follows the IF {field} {operator} {value} syntax, and the console only offers the operators that are valid for the selected field’s type.
The 14 operators fall into five groups:
| Group | Operators | When to use |
|---|---|---|
| Equality | == != | A single, exact value: one country, one method, an on/off signal |
| List membership | in not_in | Several accepted/rejected values for the same field |
| Text search | contains not_contains | The value may appear anywhere inside the field |
| Prefix / suffix | has_prefix has_suffix has_not_prefix has_not_suffix | The start/end of a path or URI — targeting directories and extensions |
| Numeric comparison | gt ge lt le | Thresholds and ranges on numeric fields like scores and status codes |
String comparisons are case-sensitive: http.user_agent contains bot matches the lowercase bot inside Googlebot/2.1, but not BOT. Enter values in the field’s actual form — verified bot names, for example, are lowercase (googlebot, bingbot).
Quick reference
Section titled “Quick reference”The In the console column is the label shown in the console menu; the Operator column is the technical name shown in the Rule Preview.
| In the console | Operator | Example |
|---|---|---|
| equals | == | ip.country == TR |
| not equals | != | http.request.method != GET |
| in list | in | ip.country in TR, DE, FR |
| not in list | not_in | ip.country not_in RU, CN |
| contains | contains | http.user_agent contains bot |
| does not contain | not_contains | http.host not_contains staging |
| starts with | has_prefix | http.request.base_uri has_prefix /api |
| ends with | has_suffix | http.request.base_uri has_suffix .php |
| does not start with | has_not_prefix | http.request.base_uri has_not_prefix /static |
| does not end with | has_not_suffix | http.request.base_uri has_not_suffix .js |
| greater than | gt | waf.bot_score gt 80 |
| greater or equal | ge | waf.bot_score ge 60 |
| less than | lt | waf.bot_score lt 20 |
| less or equal | le | waf.bot_score le 40 |
Equality: == and !=
Section titled “Equality: == and !=”The most basic operators: does the field exactly match the given value (==) or not (!=)?
# Block a single countryIF ip.country == RUTHEN block
# Tighten every method except GETIF http.request.method != GETAND http.request.base_uri has_prefix /apiTHEN ratelimit 30/60s
# CAPTCHA for Tor exit nodesIF waf.client.tor == onTHEN captchaWith these selections in the console:
- Block a single country — Field Country · Operator equals · Value
RU→ Action Block - Tighten every method except GET — Field HTTP Method · Operator not equals · Value
GETAND Field Path (without query) · Operator starts with · Value/api→ Action Rate Limit (30 requests / 60 s) - CAPTCHA for Tor exit nodes — Field Tor · Operator equals · Value Yes → Action CAPTCHA
On/off signals like waf.client.bot, waf.client.vpn and waf.client.tor only accept the equality operators (==, !=); text and list operators are not offered for these fields.
List membership: in and not_in
Section titled “List membership: in and not_in”Compares one field against several values at once: in is true when the field matches any entry, not_in when it matches none. Values are comma-separated, with a maximum of 256 values per list.
# Allow three countries, block the rest (two rules)IF ip.country in TR, DE, FRTHEN allow
IF ip.country not_in TR, DE, FRTHEN block
# Block verified bots outside search and monitoringIF waf.client.bot == onAND waf.client.bot_category not_in search, monitoringTHEN blockWith these selections in the console:
- Allow three countries — Field Country · Operator in list · Value
TR, DE, FR→ Action Allow - Block the rest — Field Country · Operator not in list · Value
TR, DE, FR→ Action Block - Block verified bots — Field Known Bot · Operator equals · Value Yes AND Field Bot Category · Operator not in list · Value
search, monitoring→ Action Block
You could reach the same result by chaining many == conditions with OR groups, but in is both more readable and costs a single condition. The ip.list field is a special case: it works only with in / not_in, and its value is the name of a list you defined under IP Lists.
Text search: contains and not_contains
Section titled “Text search: contains and not_contains”Checks whether the given value appears anywhere inside the field’s content. This is the primary tool for User-Agent filtering, header presence checks and query parameter matching.
# Block a known attack toolIF http.user_agent contains sqlmapTHEN block
# Reject API requests without an API key headerIF http.header not_contains X-Api-KeyAND http.request.base_uri has_prefix /apiTHEN blockWith these selections in the console:
- Block a known attack tool — Field User Agent · Operator contains · Value
sqlmap→ Action Block - Reject requests without an API key — Field Header · Operator does not contain · Value
X-Api-KeyAND Field Path (without query) · Operator starts with · Value/api→ Action Block
Prefix and suffix: has_prefix, has_suffix and their negations
Section titled “Prefix and suffix: has_prefix, has_suffix and their negations”Targets the start (has_prefix) or the end (has_suffix) of a field. The difference from contains is position: a /admin prefix condition does not match the path /blog/admin-tips. The negated forms (has_not_prefix, has_not_suffix) carve an area out of a rule.
# Country restriction on the admin panelIF http.request.base_uri has_prefix /adminAND ip.country != TRTHEN block
# Block .php requests (on a site that doesn't use PHP)IF http.request.base_uri has_suffix .phpTHEN block
# Rate limit everything except static filesIF http.request.base_uri has_not_prefix /staticTHEN ratelimit 100/60sWith these selections in the console:
- Country restriction on the admin panel — Field Path (without query) · Operator starts with · Value
/adminAND Field Country · Operator not equals · ValueTR→ Action Block - Block .php requests — Field Path (without query) · Operator ends with · Value
.php→ Action Block - Rate limit everything except static files — Field Path (without query) · Operator does not start with · Value
/static→ Action Rate Limit (100 requests / 60 s)
Numeric comparison: gt, ge, lt, le
Section titled “Numeric comparison: gt, ge, lt, le”Greater than, greater or equal, less than and less or equal, respectively. Valid on numeric fields: the bot score (0–100), the origin response status, the AS number and the TLS version. Combine two conditions with AND to define a range.
# Block strong bot signalsIF waf.bot_score ge 80THEN block
# CAPTCHA for the uncertain range (50 ≤ score < 80)IF waf.bot_score ge 50AND waf.bot_score lt 80THEN captcha
# Count all 4xx errors toward automatic blockingIF http.response.status ge 400AND http.response.status lt 500THEN failbanWith these selections in the console:
- Block strong bot signals — Field Bot Score (0–100) · Operator greater or equal · Value
80→ Action Block - CAPTCHA for the uncertain range — Field Bot Score (0–100) · Operator greater or equal · Value
50AND Operator less than · Value80→ Action CAPTCHA - Count all 4xx errors — Field Origin Response Status · Operator greater or equal · Value
400AND Operator less than · Value500→ Action Auto-Block
Mind the difference between ge and gt when picking thresholds: ge 80 includes a request scored exactly 80, gt 80 does not. The engine also accepts > >= < <= as synonyms for these operators.
Which field supports which operators?
Section titled “Which field supports which operators?”The console never offers an invalid combination; still, knowing the mapping speeds up rule design:
| Field type | Example fields | Operators |
|---|---|---|
| Text | http.request.base_uri, http.request.uri, http.host, http.user_agent, http.header, http.cookie, http.referer | All — equality, list, text search, prefix/suffix |
| Code / category | ip.country, http.request.method, http.request.version, waf.client.bot_category, waf.client.ip_type | == != in not_in |
| Bot name | waf.client.bot_name | == != in not_in contains |
| IP | ip.src, ip.prefix | == != in not_in |
| IP list | ip.list | Only in not_in |
| Numeric + list | ip.asnum, tls.version | == != in not_in gt ge lt le |
| Bot score | waf.bot_score | Only gt ge lt le |
| Response status | http.response.status | == != gt ge lt le |
| Response header | http.response.header | == != contains not_contains |
| On/off | waf.client.bot, waf.client.vpn, waf.client.tor, waf.client.proxy, waf.client.relay | == != |
The full operator list for every field lives on its own reference page — browse them from the Fields catalog.