Forum Discussion
johns
Employee
Mar 02, 2006iRule recognize blank space in URI?
Hi, I need to detect blank space in URI and either remove it or rewrite it:
www.mysite.com/some content/showme.html
to
www.mysite.com/some%20content/showme.html
...
Mar 09, 2006
"[TCP::payload] matches_regex "/vMoD.+Y" is a boolean comparison. It's outcome of 0 or 1 is not a command and can't be enclosed in brackets (which indicate execution of a command). If you want to extract the content, then you will have to use one of the builtin regular expression commands like regexp (Click here).
You could do something like this to look for your pattern
when CLIENT_DATA {
regexp returns 1 if a match is found
if { [regexp "/vMoD.+Y" [TCP::payload] match] }
log local0. "match found: $match"
} else {
log local0. "no match"
}
}Keep in mind that this will not return the entire URI but only the matched content. So for an URI of "http://www.foo.com/vMoDblahblahY?foobar" the value of match would be "/vMoDblahblahY" since that is the exact content that matches the pattern you requested.
To look for the full URI you are going to have to expand you regular expression to cover the rest of it.
-Joe
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
