Forum Discussion
Tim_Brown
Nimbostratus
Feb 17, 2006regsub failing
I used bl0ndie's search and replace code, the short version:
when HTTP_REQUEST {
HTTP::version 1.0
}
when HTTP_RESPONSE {
HTTP::collect 4294967295
}
w...
Feb 17, 2006
Give this a try:
when HTTP_REQUEST {
HTTP::version 1.0
}
when HTTP_RESPONSE {
HTTP::collect 4294967295
}
when HTTP_RESPONSE_DATA {
set find ":8088"
set replace ""
log local0. "payload: [HTTP::payload]"
if {[regsub -all $find [HTTP::payload] $replace new_response] > 0} {
log local0. "Match found - regsub returned greater than zero!"
log local0. "New Response: $new_response"
HTTP::payload replace 0 [HTTP::payload len] $new_response
} else {
log local0. "No match found - regsub returned zero!"
}
}All the "log" statements will put the strings into the /var/log/ltm file.
*Note1 : that I removed the $payload variable to avoid an unnecessary copy of the entire payload value.
*Note2 : Make sure you remove the log commands before moving this rule into production.
*Note3 : If you have it available, I would still highly recommend using the Stream profile for this if you can. It has much less overhead on the system.
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
