Forum Discussion
Malcom_Sargla_6
Nimbostratus
Jun 29, 2006BIGIP irule Case c279577
Dear Forum;
Can someone please assist with the following issue.
Title: iRules not operating correctly
Severity: General Assistance Condition: Open-Dispatch
Product: BI...
Jun 30, 2006
If you have to have two different HTTP_REQUEST events (Whether in the same iRule or different ones, you can disable further processing on that iRule with the event disable command (Click here).
Keep in mind that this will disable the specified event for the entire connection so if you have HTTP Keep-Alives setup (multiple HTTP requests on the same connection), it will not process any instances of that event for the duration of the connection.
when HTTP_REQUEST {
if { [matchclass [HTTP::uri] starts_with $::PRV_URIs_no_persist] } {
persist none
pool PRV-Stage
event disable
}
}
when HTTP_REQUEST {
redirect to "https://www2.provisioning.na.blackberry.com"
}The only problem here is that you are not guaranteed which event will be called first since they both that the same priority. It is very likely that your redirect event could be fired before the matchclass check. I'd specifically set a priority to ensure the first one gets fired first.
set the priority to 400
when HTTP_REQUEST priority 400 {
if { [matchclass [HTTP::uri] starts_with $::PRV_URIs_no_persist] } {
persist none
pool PRV-Stage
event disable
}
}
use the default priority of 500
when HTTP_REQUEST priority 500 {
redirect to "https://www2.provisioning.na.blackberry.com"
}See this post regarding setting priorities for events:http://devcentral.f5.com/default.aspx?tabid=28&view=topic&forumid=5&postid=1798http://devcentral.f5.com/default.aspx?tabid=28&view=topic&forumid=5&postid=1798Click here
Now, if you need to process multiple requests within the same connection then you are going to have to do some work with variables and store the state in the first and check it in the second.
set the priority to 400
when HTTP_REQUEST priority 400 {
if { [matchclass [HTTP::uri] starts_with $::PRV_URIs_no_persist] } {
persist none
pool PRV-Stage
set issue_redirect 0
} else {
set issue_redirect 1
}
}
use the default priority of 500
when HTTP_REQUEST priority 500 {
if { $issue_redirect == 1 } {
redirect to "https://www2.provisioning.na.blackberry.com"
}
}Hope one of these solutions works for you.
-Joe
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