Forum Discussion
Brian_Deitch_11
Apr 29, 2009Historic F5 Account
Well it took an act of God and some great help from Greg with F5 support but we accomplished the task at hand!
when RULE_INIT {
set this to 0 for production
set debug 1
}
when HTTP_RESPONSE {
Counter goes from 1 to 10
set data_counter 1
Disable the stream filter by default
STREAM::disable
Check if response type is html or javascript
if { ( [HTTP::header value Content-Type] contains "text/html" ) or ( [HTTP::header value Content-Type] contains "javascript" )}{
Match any http://data. and don't automatically replace it with anything
STREAM::expression "@http://data\.mydomain\.com@DUMMY@"
Enable the stream filter for this response only
STREAM::enable
}
}
when STREAM_MATCHED {
if { $::debug >= 1 } { log local0. "[IP::client_addr]:[TCP::local_port]: matched: [STREAM::match], replaced with: [string map [list "data" [format "data%u" $data_counter] ] [STREAM::match] ]" }
STREAM::replace [string map [list "data" [format "data%u" $data_counter] ] [STREAM::match] ]
Iterate the data_counter
set data_counter [ expr { $data_counter % 10 + 1 } ]
}