Sorry i missed this part then you can try something like this:
when HTTP_REQUEST {
set replace_content 0
if {[HTTP::uri] contains "/atoz/"} {
set replace_content 1
}
}
when HTTP_RESPONSE {
if {$replace_content equals "1"} {
Disable the stream filter by default
STREAM::disable
Check if response type is text
if {[HTTP::header value Content-Type] contains "text" and [HTTP::header "User-Agent"] contains "***"}{
Replace
STREAM::expression "@123@xyz@ @456@xyz@"
Enable the stream filter for this response only
STREAM::enable
}
}
}
the variable replace_content can be shared as a local variable among all the events you want. This variable will be available for this TCP connection only