Forum Discussion
Born_7758
Jul 18, 2011Nimbostratus
Modify URI among other things
Hello Everyone, Here's what I am trying to do: I have a datagroup called payment_resp_1 When I receive a request I want to match it to the URIs in the datagroup, ...
Born_7758
Jul 18, 2011Nimbostratus
I wrote this iRule but I think there should be a more efficient way of doing it. This rule doesnt use a datagroup. I wanted to use a datagroup because I plan on creating a rule that will include other members in a pool and including different possible URIs.
In the future there could be a PaymentResponse2.jsf and PaymentResponse3.jsf...if it's PaymentResponse2.jsf it'll go to a different host and if it's PaymentResponse3.jsf it'll go to another host.
The way I wanted to set up the datagroups was to group all the URIs with a 1 in them together, the ones with a 2 together, and the ones with a 3 together.
when HTTP_REQUEST {
set uri [HTTP::uri]
if { [HTTP::uri] equals "/PaymentResponse1.jsf"}{
HTTP::uri "/CSU/PaymentResponse.jsf"
pool payment_resp member 10.48.52.58 8080
log local0. "Received req1 response for $uri"
}
elseif { [HTTP::uri] equals "/PaymentError1.jsf"}{
HTTP::uri "/CSU/PaymentError.jsf"
pool payment_resp member 10.48.52.58 8080
log local0. "Received req1 response for $uri"
}
elseif { [HTTP::uri] equals "/PaymentDeclined1.jsf"}{
HTTP::uri "/CSU/PaymentDecline.jsf"
pool payment_resp member 10.48.52.58 8080
log local0. "Received req1 response for $uri"
}
elseif { [HTTP::uri] equals "/PaymentSuccess1.jsf"}{
HTTP::uri "/CSU/PaymentSuccess.jsf"
pool payment_resp member 10.48.52.58 8080
log local0. "Received req1 response for $uri"
}
elseif { [HTTP::uri] equals "/PaymentTimeOut1.jsf"}{
HTTP::uri "/CSU/PaymentTimeOut.jsf"
pool payment_resp member 10.48.52.58 8080
log local0. "Received req1 response for $uri"
}
}
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