Forum Discussion
Mikoto_Misaka_1
Nimbostratus
Mar 01, 2006the capital letter and the small letter
Hello,
I think that the operator "contains" distingushes the capital letter and the small letter.
Could you please tell me how to simply write iRule without distingushing the capital letter and the small letter ?
For example, I feel the following rule is not simple.
when HTTP_REQUEST {
if { [HTTP::uri] contains "/up/" or [HTTP::uri] contains "/Up/" or [HTTP::uri] contains "/uP/" } {
use pool pool_up
}
else {
use pool pool_others
}
}
We would like to use a conditional expression as follows.
Could you advice me ?
if { [HTTP::uri] contains "[uU][pP]" }
Mark
- Deb_Allen_18Historic F5 AccountYour second example should actually work, although you'll probably want to add the /'s back in to avoid unintentional matches:
- I believe that the "contains" operator works on standard strings, not regular expressions. You'll have to use "matches_regex" if you want match on regular expressions.
- zafer
Nimbostratus
Hello - Nicolas_Menant
Employee
Hi, - zafer
Nimbostratus
Hello - Nicolas_Menant
Employee
Could you maybe show us your whole iRule and the logging troubleshooting you did ? - zafer
Nimbostratus
here is my irule, can i see different resul when clients come from firefox or ie? - The_Bhattman
Nimbostratus
I believe so, but you have to know which request is for IE and which one is for Firefox. If you want this for your internal needs that I believe you can log the HTTP::header and determine if you are running firefox or IE at the time of the request. It's not accurate since the information can be removed, but it's a start. - G__Wesley_RoberHistoric F5 AccountThe http profile has all the appropriate settings to appropriately match URIs and content types. The real problem as I see it is that when you want to do "intelligent compression" beyond what is available in the http profile, you must use the "selective" setting in the profile. Unfortunately this setting does not do ANY compression by default. You must use the COMPRESS::enable command, which rightly ignores the content compression settings of the http profile, and will attempt to compress regardless of content type. My suggestion would be:
- G__Wesley_RoberHistoric F5 AccountBy simpler, I mean a rule like this, that disables compression for clients on a local subnet:
rule Intelligent_comression { when HTTP_REQUEST { log local0. "in HTTP_REQUEST" Compression setting in http profile should be set to selective if {[matchclass [IP::remote_addr] eq $::TrustedNets]} { log "Client on a local subnet, disabling compression. client IP: [IP::remote_addr]" COMPRESS::disable } else { log "No Match in local NET List, compressing response to client IP: [IP::remote_addr]" COMPRESS::enable } } }
Recent Discussions
Related Content
- May 24, 2019Former Member
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