Forum Discussion

Anthony_Gerace_'s avatar
Anthony_Gerace_
Historic F5 Account
Apr 06, 2006

HTTP::header not working in http_request_send event

Hi,

I am trying to use the HTTP::header command in the HTTP_REQUEST_SEND event for logging request headers. The documentation states this command should be available in this event, but using the following iRule I am not receiving any header data.

Am I missing something?

thanks.

Anthony

log statements from the ltm log file:

Apr 6 08:36:38 tmm tmm[26169]: Rule my-test-lb-select : there are 5 in this request

Apr 6 08:36:38 tmm tmm[26169]: Rule my-test-lb-select : there are 0 in this request

the request from telnet

GET / HTTP/1.0

host: test.com

cookie: spc=1;

connection: keepalive

x-client-ip: x.x.x.x

when HTTP_REQUEST {
   set hdrs [HTTP::header count]
   log local0. "there are $hdrs in this request"
}
when HTTP_REQUEST_SEND {
   set hdrs [HTTP::header count]
   log local0. "there are $hdrs in this request"
}
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Well, you can tell that the command is indeed valid under the event in question, because you're not getting a parse error when you try to load the iRule.

     

     

    The command being valid, and returning the results you're looking for are two seperate issues, however.

     

     

    What is it you're trying to accomplish by logging the number of headers in the HTTP_REQUEST_SEND event? Is it not sufficient to log them under HTTP_REQUEST for some reason?

     

     

    -Colin
  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    Try adding clientside as in:

    when HTTP_REQUEST_SEND {
       set hdrs [clientside {HTTP::header count}]
       log local0. "there are $hdrs in this request"
    }