CodeShare
Have some code. Share some code.
cancel
Showing results for 
Search instead for 
Did you mean: 
raj_77723
Nimbostratus
Nimbostratus

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
Version history
Last update:
‎05-Jun-2023 22:58
Updated by: