Forum Discussion

greenknight558_'s avatar
greenknight558_
Icon for Nimbostratus rankNimbostratus
Dec 11, 2009

Can't matchclass

HI everyone

 

 

I write the irule like following:

 

 

if { ([matchclass [string tolower [HTTP::uri]] ends_with $::ext_bypass]) or ([matchclass [HTTP::uri] starts_with $::uri_bypass]) } {

 

log local0. "hits uri [HTTP::uri]"

 

}

 

}

 

 

 

 

I also define ext_bypass and uri_bypass as following:

 

 

class ext_bypass {

 

"zip"

 

"rar"

 

}

 

 

class uri_bypass {

 

type string

 

filename "/var/class/bypasslist"

 

}

 

 

 

Tresult is [HTTP:uri] only can match $::ext_bypass,but not uri_bypass

 

bypasslist is a ascii file that contains some uri

 

I notice the ltm.log,there is no error log

 

WHY?

 

 

 

3 Replies

  • Which LTM version are you running? If it's 9.x, can you log the value for the class:

     

     

    log local0. "\$::uri_bypass: $::uri_bypass"

     

     

    For 10.x, you can use the class command to do this:

     

     

    log local0. "[class element 0 uri_bypass"

     

     

    Aaron
  • Hi

     

    LTM VERSION is 9.4.8

     

    There is no log in the ltm.log abount uri_bypass

     

    That maybe no matchclass for the uri_bypass
  • Can you add a debug line to the iRule like this:

     
     when HTTP_REQUEST { 
      
        log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::method] request to [HTTP::host][HTTP::uri]. \$::uri_bypass class contents: $::uri_bypass" 
      
        if { ([matchclass [string tolower [HTTP::uri]] ends_with $::ext_bypass]) or ([matchclass [HTTP::uri] starts_with $::uri_bypass]) } { 
           log local0. "hits uri [HTTP::uri]" 
        } 
     } 
     

    Aaron