Forum Discussion
kmtmt_51646
Nimbostratus
Nov 18, 2012How to extra strings inside "class match"
Hi Dev members,
Let me ask about "class match" function.
Here's my Data Group:
============
ltm data-group internal /Common/testgroup1 {
records {
...
hoolio
Cirrostratus
Nov 19, 2012So you could explicitly list /test, /test/ and /test/index.html in the data group and use the exact client URI for the lookup:
if { [class match -- [HTTP::path] equals testgroup2]}{
Or you could remove the trailing slash from the data group entries and trim the client's requested URI during the class lookup:
if { [class match -- [string trimright [HTTP::path] "/" ] starts_with testgroup2]}{
Note that I've used [HTTP::path] to get just the requested path without the query string in the URI for the lookup.
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