Yossi_126945
Sep 10, 2013Nimbostratus
Simple STREAM iRule doesn't work
Hi,
I'm trying to find/replace a string an an HTTP response body. Here is what I've done so far:
-
Applied the default (empty value) STREAM profile to the relevant virtual-server
-
Applied an HTTP service profile with Response Chunking set to Rechunck to the virtual-server
-
Applied the following iRule to the virtual-server
On a packet capture I can see that 'foo' string is included in the response body but it is not replaced to 'bar' and the STREAM_MATCHED event is not triggered.
LTM version is 10.2.3 Build 112.0 Final.
Is there anything I'm missing here?
when HTTP_REQUEST {
STREAM::disable
}
when HTTP_RESPONSE {
Check if response type is text
if {[HTTP::header value Content-Type] contains "text"}{
log local0. "Content-Type contains text"
Replace foo with bar in the HTTP response body
STREAM::expression {@foo@bar@}
Enable the stream filter for this response only
STREAM::enable
log local0. "Stream enabled"
}
}
when STREAM_MATCHED {
log local0. "matched: [STREAM::match]"
}