Forum Discussion
Jasa_74968
Mar 31, 2014Nimbostratus
Stop processing iRule by referencing a variable
I've set a variable in iRule named "stop_rule_processing" and its value is set to 1 if a particular iRule has a hit:
priority 300
when HTTP_REQUEST {
if { [string tolower [HTTP::path]] starts_w...
hooleylist
Mar 31, 2014Cirrostratus
Hi Jasa,
Can you try this? Also, event disable all will stop all future iRule events from triggering for the rest of the connection. The client could continue making additional HTTP requests after the current one and those will not be processed by any iRule. If you only want to skip running the iRule code from the second iRule for that request, you could use just 'return' instead.
Aaron
when HTTP_REQUEST {
if {$stop_rule_processing==1}{
event disable all
return
}
switch -glob [string tolower [HTTP::path]] {
"/staging*" {
log local0. "PreProd URL detected from [IP::client_addr] , sending to preprod pool"
pool PL-staging-pool
}
"/production*" {
log local0. "Prod URL detected [IP::client_addr] , sending to prod pool"
pool PL-production-pool
}
}
}
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