F5 is upgrading its customer support chat feature on My.F5.com. Chat support will be unavailable from 6am-10am PST on 1/20/26. Refer to K000159584 for details.

Rewriting the URL for specific pool members

How to use this snippet:

when RULE_INIT {

set static::new_app_nodes "1.1.1.1 443 2.2.2.2 443 3.3.3.3 443" 

}

when HTTP_REQUEST_SEND {

if { $static::new_app_nodes contains "[LB::server addr] [LB::server port]" } then {

    log -noname local0.debug "Match! [members -list $static::new_app_nodes] contains [LB::server addr] [LB::server port]"

    clientside {

        HTTP::uri "/uri"

    }

} else {

    log -noname local0.debug "Don't match! [members -list $static::new_app_nodes] contains [LB::server addr] [LB::server port]"

}

}

Code :

when RULE_INIT {

    set static::new_app_nodes "1.1.1.1 443 2.2.2.2 443 3.3.3.3 443" 

}

when HTTP_REQUEST_SEND {

    if { $static::new_app_nodes contains "[LB::server addr] [LB::server port]" } then {

        log -noname local0.debug "Match! [members -list $static::new_app_nodes] contains [LB::server addr] [LB::server port]"

        clientside {

            HTTP::uri "/uri"

        }

    } else {

        log -noname local0.debug "Don't match! [members -list $static::new_app_nodes] contains [LB::server addr] [LB::server port]"

    }

}

Tested this on version:

11.4
Updated Jun 05, 2023
Version 2.0
No CommentsBe the first to comment