REMOTE_ADDR
オプションが実現可能であるように見えます:
<!-- 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>