Forum Discussion
Dave_22402
Nimbostratus
Apr 19, 2010Irule switch - comment
How does one put comments into a Irule. This is on V10.
Here is an example of what I want to do - but the iRule Editor says the syntax is wrong:
when HTTP_REQUEST {
log loca...
hoolio
Cirrostratus
Apr 19, 2010Hi Dave,
DC shortens URLs now. Can you try removing the spaces from this URL to get to the page?
http:// devcentral.f5.com/Default.aspx?tabid=53&aft=1172116
What's the error that the iRule editor shows at the bottom of the code window for the red dots?
And here is an example using IP::addr to check a single host or network:
when HTTP_REQUEST {
log local0. "[IP::client_addr] IP recieved"
if {[IP::addr [IP::client_addr] equals 123.123.123.123]}{
comment on where ip is
switch -glob [string tolower [HTTP::uri]] {
"/URL/*" { pool TEST_POOL}
default { pool PROD_POOL}
}
} else {
switch -glob [string tolower [HTTP::uri]] {
"/URL/*" { HTTP::respond 301 Location https://some.location }
default { pool PROD_POOL}
}
}
}
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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