Forum Discussion
William_Murphy1
Nimbostratus
Nov 17, 2006choosing pool based on port in HOST part of HTTP header
Hi,
newbie here again but attempting some of this stuff anyway.
Trying to write an irule where the pool is decided by what is in the HTTP Header(i.e. HOST: george.george.net:8002)
The request will come with 3 possible ports 8002,8003,8004.
This is what i have written. I have left MMF_pool8002 to last because i want anything that doesnt match the 8003 or 8004 to go to this pool(i.e. MMF_pool8002).
Am I close? Or any tips
when HTTP_REQUEST {
set redirectPort [getfield [HTTP::host] ":" 2]
if { $redirectPort equals "8003" }{
pool 8003
}else if {$redirectPort equals "8004" }{
pool pool8004
} else {
pool pool8002
}
}
Please help man in desparation!
- hoolio
Cirrostratus
Is the rule working? It looks functionally correct. The only question I have is: is the field you're saving from the host header correct? Try logging the value you get for redirectport and checking the /var/log/ltm log file to verify it's what you expect. - William_Murphy1
Nimbostratus
Hi aron, - hoolio
Cirrostratus
Yep, that works:
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