Forum Discussion

Robert_Sherrard's avatar
Robert_Sherrard
Icon for Nimbostratus rankNimbostratus
Jun 03, 2006

Valid iRule for SOAPAction?

I'm looking to direct traffic based on find SOAPAction in a header... if the SOAPAction contains getWMRM... would this work?

 

 

when HTTP_REQUEST {

 

if { [matchclass [HTTP::header SOAPAction] contains "getWMRM"] } {

 

pool place_pool_here

 

}

 

else {

 

pool place_pool_here

 

}

 

}

 

 

Rob

 

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Assuming that "SOAPAction" is a valid header in your HTTP request, you wouldn't even need the matchclass section.

     

     

    Your code would be as simple as:

     

    
    if { [string tolower [HTTP::header SOAPAction] ] contains "getwmrm" } {
      pool stringFound_pool
    } else {
      pool NotFound_pool
    }

     

     

    HTH,

     

    Colin
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    The string tolower command is just a variant of the string command, which is a TCL command that allows for matching/altering string patterns.

     

     

    In this case, by using the "tolower" option, the rule is doing a case insensitive comparison.

     

     

    Colin
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Oh, by the way, there's a great set of documentation for TCL in general over at sourceforge: Click here.

     

     

    You can read more about the string command in particular in their section on it here: Click here

     

     

    HTH,

     

    Colin