Forum Discussion

sirwin_111540's avatar
sirwin_111540
Icon for Nimbostratus rankNimbostratus
Dec 01, 2009

Cannot get HTTP::header at to work

All -

 

 

I can't get [HTTP::header at] to work at all.

 

 

I searched for examples of [HTTP::header at] on the forum; I found a couple of examples, both of which are more sophisticated than what I need.

 

 

I have the following in my iRule:

 

 

set i 0

 

set thisHeader ""

 

set totalHeaders [ HTTP::header count ]

 

while { $i < $totalHeaders }

 

{

 

set thisHeader [HTTP::header at $i ]

 

incr $i

 

}

 

 

Now, ignore the pointlessness of the code for now - it's just to test with. I'm getting this error:

 

 

TCL error: My_iRule - Illegal argument. Illegal argument. Illegal argument. Illegal argument. Ille (line 1) invoked from within "HTTP::header at $i "

 

 

I've even tried this:

 

 

set myHeader [HTTP::header at 0]

 

 

Error reported:

 

TCL error: My_iRule - Illegal argument. Illegal argument. Illegal argument. Illegal argument. Ille (line 1) invoked from within "HTTP::header at 0"

 

 

Am i doing something stupidly wrong? I'm on BIG-IP 10.0.1 Build 283.0 Final.

 

 

thanks for any help!

2 Replies

  • Hi Sirwin,

     

     

    I think this is a bug (or at least change in functionality). [HTTP::header at 0] works in 9.3.1 (and did in 9.4.x if I remember correctly). From your testing and a quick check on a 10.0.1 unit, it does not work in 10.01. You could open a case with F5 Support to report the issue and find out why this is.

     

     

    If you want help figuring out a possible workaround, could you post more information on what you're trying to do?

     

     

    Thanks,

     

    Aaron
  • I have reproduced the failure in 10.1 VE as well.

     

     

    What I need to do is to show the entire HTTP Response from the server. From 200 OK HTTP/1.1 through to the end of the body.

     

    The analysis system wants this logged as a single action, not multiple actions.