Forum Discussion
JRahm
Admin
Aug 02, 2006WebLogic information extraction
Our weblogic servers will give me an active list of servers in the X-WebLogic-Cluster-List header if I supply the X-Weblogic-Request-ClusterInfo header with a value of true. This is the missing piece...
Deb_Allen_18
Aug 05, 2006Historic F5 Account
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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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