Forum Discussion

  • Hi,

    I asked myself, if [HTTP::method] would detect the DEBUG verb, although the http profile does not support it.

    Result: Yes it works.

    [HTTP::method] delivers whatever string comes first in the TCP connection, until the first blank.

    local/tmm info tmm[5191]: Rule rule1 : HTTP::request: DEBUG / HTTP/1.0

    local/tmm info tmm[5191]: Rule rule1 : HTTP::method: DEBUG

    local/tmm info tmm[5191]: Rule rule1 : HTTP::request: DEBUG DEBUG / HTTP/1.0

    local/tmm info tmm[5191]: Rule rule1 : HTTP::method: DEBUG

    local/tmm info tmm[5191]: Rule rule1 : HTTP::request: DEBUG_DEBUG / HTTP/1.0

    local/tmm info tmm[5191]: Rule rule1 : HTTP::method: DEBUG_DEBUG

    INTERESTING! If there is a blank in front of the first string, [HTTP::method] returns nothing.

    local/tmm info tmm[5191]: Rule rule1 : HTTP::request: BLANK_IN_FRONT / HTTP/1.0

    local/tmm info tmm[5191]: Rule rule1 : HTTP::method:

    However, that's O.K., as the HTTP RFC defines a Request-Line like this:

    Request-Line = Method SP Request-URI SP HTTP-Version CRLF

    While method is one of the well known strings "GET", "POST", etc.

    Regarding your request, you might use the iRule below as a template.

    when HTTP_REQUEST {
    
       if { [HTTP::method] equals "DEBUG" } {
    
             do something
            log local0. "DEBUG method found"
       }
    }
    

    Regards

    Kurt Knochner