Forum Discussion
Lucas_Kaczmars1
May 20, 2019Altostratus
irule - stop processing on condition match
Hello, I searched for this answer and I've found that using 'event disable all' should exit processing the irule below, but it still goes to the second 'if' statements and evaluates it. Can someon...
- May 20, 2019
You could rewrite the iRule using nested 'if' statements so you don't need a return, that way, you only check the host header once
when HTTP_REQUEST { if {[string tolower [HTTP::host]] eq "test.website.com"} { if {[string tolower [HTTP::path]] starts_with "/authentication"} { log local0. "Accepted request test.website.com/authentication [HTTP::uri] for client [IP::client_addr]" } else { log local0. "Rejected request test.website.com [HTTP::uri] for client [IP::client_addr]" reject } } }
Lee_Sutcliffe
May 20, 2019Nacreous
You could rewrite the iRule using nested 'if' statements so you don't need a return, that way, you only check the host header once
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] eq "test.website.com"} {
if {[string tolower [HTTP::path]] starts_with "/authentication"} {
log local0. "Accepted request test.website.com/authentication [HTTP::uri] for client [IP::client_addr]"
} else {
log local0. "Rejected request test.website.com [HTTP::uri] for client [IP::client_addr]"
reject
}
}
}
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