Forum Discussion
Michael_Mau_108
Nimbostratus
Feb 16, 2008REGEXP parsing URI
Hello all,
I have a customer who assigns each of his 100+ users with a service name, so he is able to indentify who each customer group is, and what environment they are trying to access (acceptance, test, or production. And example is XML_TCPP_T (test example). This service name is always capitol, and always the first part of the URI.
I have created an I-rule that should compare this service name, and reject requests based on whether it matches or not; but and having problems. I am not showing any errors in the i-rule stats, but the customer is saying requests that should be rejected are passing though.
We are currently using v.9.0.1, but have certified and are upgrading to v9.3.1 shortly. The only thing I can think of, is the "discard" line is not working as expected. I was hoping someone could take a look at my i-rule, or was wondering if there are any known errors with the discard command in my current version.
when HTTP_REQUEST {
if { [regexp matches_regex {XML_[A-Z]*_(P|T)} [HTTP::uri]] }
{
discard
}
}
Thanks for any unsight you can provide.
-Mike
- The_Bhattman
Nimbostratus
Hi Mike, - Don't forget the "-glob" argument to switch to enable the "file-globbing" matching.
switch -glob [HTTP::uri] { "XML_[A-Z]*_P" { do something } "XML_[A-Z]*_T" { do something } default { do something else } }
switch -glob [HTTP::uri] { "XML_[A-Z]*_[PT]" { do something } default { do something else } }
switch -glob [HTTP::uri] { "XML_[A-Z]*_P" - "XML_[A-Z]*_T" { do something } default { do something else } }
- Michael_Mau_108
Nimbostratus
Thanks for the replies. I appreciate it. I still have to put more thought into which version would be the most effective: - Nicolas_Menant
Employee
If your iRule doesn't match anything the BIGIP will use the pool defined in your vs configuration.
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