Reselect pool based http response

I am looking for an Irule with reselect the members if there is 503 http response code from the server instead of giving the response to the client. We are using the dns pool.

I have never tried this. You may have to test it out in a test VIP before implementing it:

when HTTP_RESPONSE { 
if { [HTTP::status] contains "503" } {
persist none
LB::detach
LB::reselect pool <>
} 
}

Both examples in the wiki article for HTTP::retry show how to do this: