Forum Discussion
Patrick_Chang_7
Mar 29, 2008Historic F5 Account
How to get server IP when LB_Selected
when HTTP_REQUEST {
set clientIP [IP::client_addr]
}
when LB_SELECTED {
set serverIP [serverside {IP::remote_addr}]
}
when LB_FAILED {
log local0. "LB Failed for client $clientIP and server $serverIP"
}I am trying to grab the server IP when the the LB selection is made. However, it is saying that IP::remote_addr is undefined in the serverside context at the time of this event. What is the right way to get this?
2 Replies
- The_Bhattman
Nimbostratus
Try thiswhen HTTP_REQUEST { set clientIP [IP::client_addr] } when LB_SELECTED { set serverIP [LB::server addr] } when LB_FAILED { log local0. "LB Failed for client $clientIP and server $serverIP" }
/cb - mycisco_65288
Nimbostratus
LB_ SELECTED
Enter a topic name to show or a new topic name to create; then press Enter
.
Description | Examples | Related Information
Description
Triggered when the system selects a pool member.
Examples
when LB_SELECTED {
if { [IP::addr [IP::remote_addr] equals "10.0.0.1"] } {
snat VIPsnat
}
}
Related Information
Available Commands:
IP::client_addr, IP::local_addr, LB::reselect, LB::server, priority, SSL::sessionid, SSL::unclean_shutdown, SSL::verify_result,
Returns the client IP address of a connection.
6/29/2007 5:51:27 PM - deb
Returns IP address value of the virtual or self-ip the client is connected to.
3/29/2007 3:38:35 PM - hoolio
Advance the load balancing pointer
4/12/2007 5:10:50 AM - citizen_elah
Returns information about the currently selected server
7/22/2007 9:01:41 PM - jpruitt
The priority command is used to set the order that like iRule events are executed.
8/16/2007 4:57:23 PM - deb
Gets the SSL session ID.
8/28/2007 5:30:46 PM - spark
Sets the value of the *Unclean Shutdown* setting.
8/28/2007 4:50:53 PM - spark
Gets or sets the result code for peer certificate verification.
8/27/2007 5:58:32 PM - spark
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