class match/data group - uri pool selection failing...

Hello,

I have an iRule that is giving me some trouble. I created a string datagroup of several URIs. The goal is just to look for a match on a particular URI and then send to the pool if a match is found. Otherwise, send the request to the landing page. The LTM is running 10.2.0 1707.15. For some reason, EVERY reqeust always goes to the landing page. A match is never found. The first line in the datagroup is another option I was trying. Any help would be very much appreciated.

when HTTP_REQUEST {

if { [class match [string tolower [HTTP::uri]] starts_with DMPS_URI_List] } {

pool DMPS_Stage_88

}

else {

HTTP::redirect “https://apps.company.com/”

}

}

class DMPS_URI_List {

{

“bpptasks” { “apps.company.com/bpptasks/” }

“dpptsks”

“jpptasks”

“lpptasks”

“gpptasks”

“mppatasks”

“opptasks”

}

}

Thank you,

can u try this one?

class DMPS_URI_List {

{

“/bpptasks” { “/apps.company.com/bpptasks/” }

“/dpptsks”

“/jpptasks”

“/lpptasks”

“/gpptasks”

“/mppatasks”

“/opptasks”

}

}

I added the slashes but it still fails. Any ideas?

I added the slashes but it still fails. Any ideas?

Correction, with this datagroup, the URIs are not parsed correcly and it always goes to the landing page, regardless of the URI. Right now I have been testing with /bpptasks mainly. Any idea why the URIs are not being parsed correctly???

class DMPS_URI_List {

{

“/”

“/bpptasks” }

“dpptsks”

“jpptasks”

“lpptasks”

“gpptasks”

“mppatasks”

“opptasks”

}

}

The / entry is potentially going to match every request as all local URIs will start with /. Try removing that one and then test the others. If you’re still not seeing the results you’re expecting, try putting in a log statement under the pool statement and the else statement.

Aaron

Ok, I removed the single “/” entry. I also tried adding two slashes such as //bpptasks/ but it made no diffference. When I log for a match and for the redirect, I get no matches. It just sends everything to the landing page and never matches on a URI.

Do we know if this is a bug in 10.2.0 1707.15?

Can you paste the current rule/datagroup again?

Here is the current version:

when HTTP_REQUEST {

if { [class match [string tolower [HTTP::uri]] starts_with DMPS_URI_List] } {

pool DMPS_Stage_88

log local0.info “Match found for [HTTP::uri]”

}

else {

HTTP::redirect “https://apps.company.com/”

log local0.info “NO Match found for [HTTP::uri]”

}

}

class DMPS_URI_List {

{

“//bpptasks”

“//dpptasks”

“//jpptasks”

“//lpptasks”

“//mpptasks”

“//opptasks”

}

}

You’ll want to remove one of the leading forward slashes from the datagroup entries.

Aaron

I’ve already tried that. I started out with a single leading slash but it made no difference so I began experiementing. I will remove the leading slashes right now though.

Any more ideas?

I’ve already tried that. I started out with a single leading slash but it made no difference so I began experiementing. I will remove the leading slashes right now though.

Any more ideas?

Can you update the class so it’s like this:

class DMPS_URI_List {
   {
      "/bpptasks"
      "/dpptasks"
      "/jpptasks"
      "/lpptasks"
      "/mpptasks"
      "/opptasks"
   }
}

And then use the logging in this iRule to test:

when HTTP_REQUEST {
   if {  [class match [string tolower [HTTP::uri]] starts_with DMPS_URI_List] } {
      pool DMPS_Stage_88
      log local0.info "Match found for [HTTP::uri] in [class get DMPS_URI_List]"
   } else {
      HTTP::redirect "https://apps.company.com/"
      log local0.info "NO Match found for [HTTP::uri] in [class get DMPS_URI_List]"
   }
}

And post the debug logging from /var/log/ltm for a few requests which fail?

Aaron

What is the log saying?