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 {
...
kmtmt_51646
Nimbostratus
Nov 18, 2012Hi hoolio,
Thank you for your reply!
And let me correct what I wrote
>a) http://www.example.com/test
>b) http://www.example.com/test/index.html
>c) http://www.example.com/directory/test/index.html
>d) http://www.example.com/testing/index.html
-> a) and b) is correct URL to be sent to pool-true, but c) and d) are false, which is to be sent to pool-false.
as you advise, I can put "/test" and "/test/" into 1 datagroup, but then I can use either "equals" or "start_with", and if I do "start_with /test || /test/", above URL d) will be false-positive...
trimright sounds a very nice idea, but again, I cannot differentiate b) and d) .
So I trimright datagroup as follows. Didn't get any error, but it seems not working to trimright datagroup...
=========
when HTTP_REQUEST {
if { [class match -- [HTTP::uri] starts_with testgroup2] || [class match -- [HTTP::uri] equals [string trimright "testgroup2" "/"]]}{
pool pool-true
} else {
=========
I guess I should do with 2 datagroups...
Thank you anyway!
kmtmt
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