# client request rule

**URL:** <https://community.f5.com/t/client-request-rule/56336>\
**Category:** Technical Forums\
**Tags:** irules, security, ltm, application-delivery\
**Created:** [August 24, 2020, 7:47am UTC](https://community.f5.com/t/client-request-rule/56336 "2020-08-24T07:47:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![suthomas1](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@suthomas1](https://community.f5.com/u/suthomas1)\
**Post date:** [August 24, 2020, 7:47am UTC](https://community.f5.com/t/client-request-rule/56336/1 "2020-08-24T07:47:24Z")

</div>

Good day all,

We have recently taken over a subsidary of ours and f5 is one of their devices.

In a virtual service, this irule is found. I am trying to understand what this does with the virtual server traffic.

Please help me to understand what this is used for. The service is an https that converts the client requests to another port on the pool member.

( some of these have been slightly changed here for discreet purpose)

when CLIENT\_ACCEPTS {

set retry 0

}

when HTTP\_REQUEST {

set http\_request [HTTP::request]

}

when HTTP\_RESPONSE {

if { ([HTTP::status] starts\_with “4”)} {

incr retry

if { $retry \<= [active\_members [LoB::pool]] } {

HTTP::retry $http\_request

} else {

set retry 0

}

} else {

set retry 0

}

}

when ltm-pass {

if { ($retry \> 0) && ($retry \<= [active\_members [LoB::pool]])} {

LB::reselect pool [LoB::pool]

log local0.info “New LB server is [LoB::xyz]”

}

}

when ltm-fail {

if { $retry \<= [active\_members [LoB::pool]]} {

incr retry

LoB::reselect pool [LoB::pool]

}

}

---

<div class="post-metadata">

**Author:** ![Andrew-F5](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@Andrew-F5](https://community.f5.com/u/Andrew-F5)\
**Post date:** [August 26, 2020, 3:41pm UTC](https://community.f5.com/t/client-request-rule/56336/2 "2020-08-26T15:41:08Z")

</div>

The very short summary: this iRule will (1) force an HTTP request to be [resent](https://clouddocs.f5.com/api/irules/HTTP__retry.html) if it initially receives a 4xx level response from the server (2) log the pool member that is selected after the first request fails and it retries (3) try [selecting](https://clouddocs.f5.com/api/irules/LB__reselect.html) a new pool member if the first one fails.

[LB::reselect](https://clouddocs.f5.com/api/irules/LB__reselect.html)

[HTTP::retry](https://clouddocs.f5.com/api/irules/HTTP__retry.html)
