이 가능하다 :
<!-- Condition for even IPs (50% connections) -->
<add input="{REMOTE_ADDR}" pattern=".+[02468]$"/>
<!-- Condition for odd IPs (the other 50% connections): -->
<add input="{REMOTE_ADDR}" pattern=".+[13579]$"/>
당신은 쉽게 패턴을 변경하여 그것을 30/70 또는 10/90을 만들 수 있습니다. 임의의 방법으로 쿠키를 설정
예 구성 :
<rewrite>
<outboundRules>
<rule name="set new=1 on half the requests" preCondition="new-cookie-is-not-set">
<match pattern=".*" serverVariable="RESPONSE_Set_Cookie"/>
<conditions trackAllCaptures="false">
<add input="{REMOTE_ADDR}" pattern=".+[02468]$"/>
</conditions>
<action type="Rewrite" value="new=1; Expires=Fri, 26 Apr 2020 00:00:00 GMT; HttpOnly"/>
</rule>
<rule name="set new=0 on the other half" preCondition="new-cookie-is-not-set">
<match pattern=".*" serverVariable="RESPONSE_Set_Cookie"/>
<conditions trackAllCaptures="false">
<add input="{REMOTE_ADDR}" pattern=".+[13579]$"/>
</conditions>
<action type="Rewrite" value="new=0; Expires=Fri, 26 Apr 2020 00:00:00 GMT; HttpOnly"/>
</rule>
<preConditions>
<preCondition name="new-cookie-is-not-set">
<add input="{HTTP_COOKIE}" negate="true" pattern="new=[01]"/>
</preCondition>
</preConditions>
</outboundRules>
</rewrite>