Forum Discussion
Irule for Redirection
Please help me with the irule to redirect the traffic based on specific URI to a pool-1 else (All other traffic)redirect to Pool-2. Along with iRule should log the information(Source and destination) in Logs
5 Replies
- RaghavendraSY
Altostratus
iRule for pool redirection is mentioned below: when HTTP_REQUEST { if { [HTTP::uri] starts_with "/abc" } { pool pool1 } elseif { pool pool2 } }
- RaghavendraSY
Altostratus
You can log client IP using below irule
when CLIENT_ACCEPTED { log local0. "[virtual] - client ip=[IP::client_addr]" }
- RaghavendraSY
Altostratus
This is for server end connection:
when SERVER_CONNECTED {
log local0. "Source IP address for connection to node: [getfield [IP::local_addr] "%" 1]"
}
- surajsah
Nimbostratus
LOG SOURCE AND DEST. IP
when HTTP_RESPONSE { log local0. "The Client IP address is [clientside {IP::remote_addr}] is connected with Server IP is [serverside {IP::remote_addr}]" }
OR, (BOTH ARE DIFFERENT BASED ON EVENT AND APPLICATION)
when SERVER_CONNECTED { log local0. "The Client IP address is [clientside {IP::remote_addr}] is connected with Server IP is [serverside {IP::remote_addr}]" }
- Lee_Sutcliffe
Nacreous
It is worth noting that simple iRule logic like can can now be achieved using Local Traffic Policies in the GUI. These may be easier for teams without much iRule knowledge - Profiles are also less expensive from a performance perspective than iRules. However you obviously lack the granularity of iRules.
Recent Discussions
Related Content
* 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