Forum Discussion
habib_Khan
Nimbostratus
Mar 02, 2016irule not functioning
I am using below irule for switching connection between pools depending on request. Its not working as needed.
Need help.
when HTTP_REQUEST {
set low_hostname [string tolower [HTTP::host]]
set ...
Kai_Wilke
MVP
Mar 02, 2016Hi Habib,
just noticed, that the ordering of your iRule is little faulty. You have to use the most restrictiv condition before the less restrictive conditions, otherwise then later conditions wouldn't trigger...
when HTTP_REQUEST {
set low_hostname [string tolower [HTTP::host]]
set low_uri [string tolower [HTTP::uri]]
if { ( $low_hostname equals "topsuat" ) and ( $low_uri starts_with "/socket.io" ) } then {
pool topsuat-socket-pool
} elseif { ( $low_hostname contains "topsstg" ) and ( $low_uri starts_with "/socket.io" ) } then {
pool topsstg-socket-pool
} elseif { ( $low_hostname equals "topssit" ) and ( $low_uri starts_with "/socket.io" ) } then {
pool topssit-socket-pool
} elseif { ( $low_hostname equals "topsstrg" ) and ( $low_uri starts_with "/socket.io" ) } then {
pool topstrg-socket-pool
} elseif { $low_hostname contains "topsfat" } then {
pool topsfat-prod-pool
} elseif { $low_hostname contains "topsstg" } then {
pool topsstg-pool
} elseif { $low_hostname contains "topssit" } then {
pool topssit-http
} elseif { $low_hostname contains "topstrg" } then {
pool topstrg-pool
}
Note: In addition I would recommend to check the host and pool names. You have "topsuat" (for
) but "topsfat" (for /socket.io
) and also a slightly mixed naming convention for the pool names which may cause additional confusion. Also check your /*
and contains
. Sometimes you're using one and sometimes the other...equals
Cheers, Kai
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