OK, how about something like this?:
when HTTP_RESPONSE {
if { [HTTP::header exists "X-WebLogic-Cluster-List"] }{
set server_mappings [split [HTTP::header "X-WebLogic-Cluster-List"] "|" ]
init array if non-existent
array set ::ServerList { }
clear pre-existing array entries
(re-initializing as blank array doesn't seem to do it)
array unset ::ServerList
foreach server $server_mappings {
set ::ServerList($server) [getfield [findclass $server $::server_name_to_IP] " " 2]
}
}
}
which would create the following ServerList array:
{
-306262974 10.1.1.10
-572170000 10.1.1.11
-851958269 10.1.1.12
-896443913 10.1.1.13
-937189304 10.1.1.14
}
then once you've extracted the jsession string (i.e. Gsfsafavlaeruae!-306262974!-851958269) from cookie or URI, you can extract the primary & secondary server IP from the array using the WL server IDs like this:
array get ::ServerList [getfield $jsessionstring "!" 2]
array get ::ServerList [getfield $jsessionstring "!" 3]
HTH
/deb