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 07, 2006Historic F5 Account
Yikes, I see your confusion -- I left out the extraction of the server details needed to build the array. Sorry about that. I think this is more what you are after:
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 servermap $server_mappings {
set serverID [getfield $servermap "!" 1]
set serverName [getfield $servermap "!" 2]
set ::ServerList($serverID) [getfield [findclass $serverName $::server_name_to_IP] " " 2]
}
}
}or to eliminate setting those 2 extra variables, inline substitution gives you: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 servermap $server_mappings {
set ::ServerList([getfield $servermap "!" 1]) [getfield [findclass [getfield $servermap "!" 2] $::server_name_to_IP] " " 2]
}
}
}Clear as mud, now, eh?(getfield starts indexing @ 1, while lindex starts @ 0.)
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