ltm rule command STREAM match
iRule(1) BIG-IP TMSH Manual iRule(1)
STREAM::match
Returns the matching characters.
SYNOPSIS
STREAM::match
DESCRIPTION
Returns the matching characters.
Syntax
STREAM::match
* Returns the matching characters.
RETURN VALUE
Returns the matching characters.
VALID DURING
EXAMPLES
Log each stream filter match (as configured in a stream profile or in
an iRule using STREAM):
when STREAM_MATCHED {
# Log each match found by the stream filter
log local0. "Stream filter matched: [STREAM::match]"
}
Replace any http:// instance with https:// only if the original string
is http://*example.com.
when HTTP_REQUEST {
# Disable the stream filter for all requests
STREAM::disable
}
when HTTP_RESPONSE {
# Disable the stream filter by default
STREAM::disable
# Check if response type is text
if {[HTTP::header value Content-Type] contains "text"}{
# Match any http:// instance and replace it with nothing
STREAM::expression {\@\@http://.*?example\.com@@}
# Enable the stream filter for this response only
STREAM::enable
}
}
when STREAM_MATCHED {
log local0. "[IP::client_addr]:[TCP::local_port]: matched: [STREAM::match], replaced with: [string map {http:// https://} [STREAM::match]]"
STREAM::replace "[string map {http:// https://} [STREAM::match]]"
}
HINTS
SEE ALSO
CHANGE LOG
@BIGIP-9.2.0 --First introduced the command.
BIG-IP 2017-01-31 iRule(1)