Forum Discussion

Bert_Vandebroek's avatar
Bert_Vandebroek
Icon for Nimbostratus rankNimbostratus
Jun 09, 2008

selective HTTP_RESPONSE_DATA

Hi guys,

 

 

Is there a way to do a selective HTTP_RESPONSE_DATA depending on the url a user is accessing ?

 

Got a problem with the customization of HFM, the app server has some issues with ssl ofloading so

 

we had to write a little irule that takes care of this

 

from the forums we found that with a HTTP_RESPONSE_DATA and HTTP_RESPONSE we could re-write the output

 

 

Now, I would need to enable / disable this depending on the url a user is using

 

HTTP::uri cannot be used, is there something else I can try ?

 

 

cheers

 

b

 

1 Reply

  • Hi,

    You can create datagroup (aka a class) containing the URI's or URI fragments that you want to collect the response data for. For a datagroup, the type would be string and it would look like this in the bigip.conf:

     
     class my_uris { 
        "/uri1" 
        "/uri2" 
        "/uri3" 
     } 
     

    You could then use matchclass to check if the requested URI matches the class:

     
     when HTTP_REQUEST { 
      
         Check if the requested URI is part of the class 
        if {[matchclass [HTTP::uri] starts_with $::my_uris]}{ 
      
            Track that we want to collect the response data 
           set collect_response 1 
        } else { 
            Track that we do not want to collect the response data 
           set collect_response 0 
        } 
     } 
     when HTTP_RESPONSE { 
      
         Check if we're collecting the response 
        if {$collect_response}{ 
        ... 
        } 
     } 
     

    If you're replacing strings within the response payload, it would be faster/more efficient to use a stream profile and the STREAM:: commands to do it. For more info on the STREAM:: commands, you can check the wiki page (Click here).

    Aaron