Forum Discussion
southern_nordic
Altocumulus
Oct 06, 2023Redirect URIs in datagroup to dedicated node
Hi Could you help identify why I get the following error below when applying this irule. ERROR ===================================== :9: error: ["wrong # of arguments"][class match -value $re...
southern_nordic
Altocumulus
Oct 06, 2023Thanks Paulios, I should have mentioned we have a default pool and I had intended to create a seperate pool for this traffic.
I applied your irule , however I received the following error
01070151:3: Rule 13: error: ["== is unexpected; it should be one of 'contains ends_with equals starts_with'"][class match -- ${request_uri} == ACL_Intranett-webforms]
Paulius
MVP
Oct 06, 2023southern_nordic It looks like class match doesn't like using "==" and instead wants "eq" which I have corrected below.
when CLIENT_ACCEPTED priority 500 {
set DEFAULT_POOL [LB::server pool]
}
when HTTP_REQUEST priority 500 {
# Get the request URI
set request_uri [HTTP::uri]
# Check if the request URI matches any entry in the data group
if { [class match -- ${request_uri} eq ACL_Intranett-webforms] } {
# Set the persistence cookie name
set persistence_cookie_name "stick_cookie_name"
# Check if the persistence cookie exists
set cookie_value [HTTP::cookie ${persistence_cookie_name}]
if { ${cookie_value} == "" } {
# If the cookie doesn't exist, create and set the cookie
set cookie_value [IP::client_addr]
HTTP::cookie insert ${persistence_cookie_name} ${cookie_value}
}
# Set the persistence based on the cookie
persist uie cookie ${persistence_cookie_name}
pool POOL_ACL_Intranett_Webforms
} else {
pool ${DEFAULT_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