Forum Discussion
Anthony_Vaz_547
Jul 07, 2009Nimbostratus
Thanks Aaron
Apologies, I wasn;t clear in my message before. It wasn;t so much that the regular expression was wrong, but when I include the regular expression in the expression, the web pages do not load.
I thought I was using the wrong syntax, and I have changed my irule as you suggested to utilise STREAM_MATCHED. As you suspected this has allowed me to trouble shoot further.
The new rule now looks as follows
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 'top.' instance and replace it with nothing
STREAM::expression {&top\.(?!jpg)&&}
Enable the stream filter for this response only
STREAM::enable
}
}
when STREAM_MATCHED {
if {[STREAM::match] contains "jpg"} {
return
} else {
STREAM::replace "[string map {top. top.child2.} [STREAM::match]]"
}
}
Again, when enabling this new irule, no web pages will load. However, I am now getting the following error message in the /var/log/ltm file
Jul 7 15:39:57 tmm tmm[925]: 01220001:3: TCL error: Rule irule_EPMResponseTopToSelfTST - couldn't compile regular expression pattern: quantifier operand invalidIllegal argument (line 1) invoked from within "STREAM::expression {&top\.(?!jpg)&&} "
Jul 7 15:40:20 tmm tmm[925]: 01220005:3: Can't compile regular expression - (top\.(?:?!jpg))
Jul 7 15:40:20 tmm tmm[925]: 01220001:3: TCL error: Rule irule_EPMResponseTopToSelfTST - couldn't compile regular expression pattern: quantifier operand invalidIllegal argument (line 9) invoked from within "STREAM::expression {&top\.(?!jpg)&&} "
It's curious that it thinks the regular expression is ' (top\.(?:?!jpg)) ' rather than ' top\.(?!jpg)'
Our BigIP is running 9.3.1 but have so far not found any regular expression bugs that may cause this
Does this help shed any more light on what the problem may be?