Forum Discussion
3 Replies
Sort By
- Michael_YatesNimbostratusHi apache2020,
- Hi,
when HTTP_REQUEST { if { [HTTP::method] equals "DEBUG" } { do something log local0. "DEBUG method found" } }
- apache2020_1037Nimbostratusthanks Kurt
Is it possible to write an irule to trigger on an HTTP VERB type of DEBUG?
thanks
David
I don't think that "DEBUG" is a valid HTTP Verb / Method, but you can capture the the method with HTTP::method
RFC2616 - Method Definitions
Hope this helps.
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
will test this in the lab and see how it goes!
David