Forum Discussion
Bert_Vandebroek
Nimbostratus
Jun 09, 2008selective 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 issue...
hoolio
Cirrostratus
Jun 09, 2008Hi,
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
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
