Forum Discussion

Mark_58017's avatar
Mark_58017
Icon for Nimbostratus rankNimbostratus
Jan 09, 2013

iRule to check header length

Hi,

 

I have a customer that wishes to send larger queries to a different pool. He's noticed the difference between queries can be decided by header length. He wants an iRule that picks up another pool if the header length is over 50k.

 

I've tried a couple of different iRules pulled from here and amended to no avail. I haven't specified them as I'm looking for a fresh take on the problem.

 

Thanks in advance.

 

 

6 Replies

  • Apologies I wasn't clear it is the payload length that we wish to interrogate.
  • If the client sets a content-length header in the request you could check that with [HTTP::header Content-Length]:

    
    when HTTP_REQUEST {
        Check if client is sending more than 500 bytes
       if { [HTTP::header Content-Length] > 500 }{
           Select big_pool
          pool big_pool
       } else {
          pool my_default_pool
       }
    }
    

    Aaron

  • Thanks, I'm not sure if that field is in there but I've stuck it on there to test.
  • For payload length maybe - http::payload length

     

     

    https://devcentral.f5.com/wiki/irules.http__payload.ashx