Forum Discussion
ryank5589
May 21, 2020Nimbostratus
iRule expressions for not-eqauls in datagroup
Hey all, I am looking to create an irule to match a uri and datagroup list (IP address in datagroup) to send to the pool, then if it matches the same uri and it doesn't match the ip address in...
cjunior
May 22, 2020Nacreous
Hi,
Put "not" before checking the class match. Same as "if not true"
not [class match [IP::client_addr] equals JAVA_Networks]
But in this case, it is better to check "when it is true" to send to a pool otherwise do redirect.
when HTTP_REQUEST {
# Only check when URI is exactly /logon/java
if { [HTTP::uri] equals "/logon/java" } {
# If IP address is in group, it is True
if { [class match [IP::client_addr] equals JAVA_Networks] } {
pool pool_java_uri_443
# Else, that's not True as IP is absent
} else {
HTTP::redirect https://externalpage.com/notjava
}
}
}
Regards
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