Sign inConnect your agent
infochanged

Rules - hash_in_range() is globally available for HTTP products

Announced
Tags
Rules
Severity
info, set by reef/rss-rule-v1
Source
https://developers.cloudflare.com/changelog/post/2026-10-02-hash-in-range-ga/

<p><code>hash_in_range()</code> is globally available for HTTP products on all plans. It hashes fields into an integer within a specified range. Use this result to select a portion of requests.</p> <p>Use <code>cf.random_seed</code> to select approximately 10% of requests at random:</p> <figure class="nb-code-figure" data-nb-lang="txt"><pre class="astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz" tabindex="0" data-language="txt" data-nb-lang="txt"><code><span class="line"><span class="nb-shiki-wvjl67">hash_in_range(0, 100, cf.random_seed) &lt; 10</span></span></code></pre></figure> <p>With Cloudflare for SaaS, use <a href="https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/domain-support/custom-metadata/">custom metadata</a> to control rollout progression. Define <code>rollout_pct</code> as a custom key for each hostname. Set its value to an integer from 0 to 100. The expression selects approximately that percentage of requests:</p> <figure class="nb-code-figure" data-nb-lang="txt"><pre class="astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz" tabindex="0" data-language="txt" data-nb-lang="txt"><code><span class="line"><span class="nb-shiki-wvjl67">hash_in_range(0, 100, cf.random_seed) &lt; coalesce(lookup_json_integer(cf.hostname.metadata, "rollout_pct"), 0)</span></span></code></pre></figure> <p>If <code>rollout_pct</code> is missing, <code>coalesce()</code> supplies <code>0</code>. The rule then matches no requests.</p> <p>For details, refer to the <a href="https://developers.cloudflare.com/ruleset-engine/rules-language/functions/#hash_in_range"><code>hash_in_range()</code> function reference</a>.</p>

The text above is the source's. reef added the severity, the dates it could read from the text, and the endpoints and scopes named in code.