Forum Discussion
MarcoP
Jul 20, 2022Nimbostratus
iRule with JSESSIONID including the server id with jvmRoute
Dears, unfortunately I did not find a fitting post to my problem: We have two or more servers they creating a JSESSIONID where the id of the server is added on the end like so: 7B0DE3926CF23C2...
xuwen
Jul 20, 2022Cumulonimbus
# first create 3 pool,name is pool_node0, pool_node1, pool_default
# pool_node0 member 10.1.1.10:80 monitor tcp
# pool_node1 member 20.1.1.20:80 monitor tcp
# pool_default member 10.1.1.10:80 20.1.1.20:80 monitor tcp
iRuels code:
when RULE_INIT {
array set static::pool_array {
0 pool_node0
1 pool_node1
}
}
when HTTP_REQUEST {
if { [HTTP::cookie exists "JSESSIONID"] } {
set node_x [findstr [HTTP::cookie "JSESSIONID"] "serverID" 8 1]
log local0. "node_x is $node_x"
if { [active_members [lindex [array get static::pool_array $node_x] 1]] == 0 } {
pool pool_default
} else {
pool [lindex [array get static::pool_array $node_x] 1]
}
} else {
pool pool_default
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects