Greg_Ryan_33844
Jan 25, 2013Nimbostratus
Stream::Enable irule executing when it shouldn't
Hi, I have an irule that we implemented that is executing correctly for the if statement. However it's also executing half the time when it shouldn't be. Within the Lifelink_CBD_ClientNets class I have "10.33. 10.20. 192.168.". When I connect from any ip that starts with those the irule works 100% of the time. However, when I connect with a different IP it still executes sometimes.
I have put in logging into the IF statement to grab the IP, and when I come from an IP that isn't in the CBD_ClientNets then it doesn't log, but it makes the change. I am completely stumped
Below is the irule:
Prevents server compression in responses
when HTTP_REQUEST {
Disable the stream filter for all requests
STREAM::disable
LTM does not uncompress response content, so if the server has compression enabled
and it cannot be disabled on the server, we can prevent the server from
sending a compressed response by removing the compression offerings from the client
HTTP::header remove "Accept-Encoding"
}
when HTTP_RESPONSE {
If Client is from CBD then we do the rewrites
if { [matchclass [IP::client_addr] starts_with $::Lifelink_CBD_ClientNets] } {
Check if response type is text
if {[HTTP::header value Content-Type] contains "text"}{
Replace frd01mediac01 with cbd01mediac01
STREAM::expression {@[Ff][Rr][Dd]01[Mm][Ee][Dd][Ii][Aa][Cc]01@cbd01mediac01@}
Enable the stream filter for this response only
STREAM::enable
log local0. "You're in carlsbad [IP::client_addr] - modification required"
}
}
}