Forum Discussion
Jul 15, 2005
matches_regex is too much overhead. You should probably just use the contains rational operator. You can also chain the conditions up with OR's. I've thrown in some logging that you can remove if things are working for you. Check in the /var/log/ltm file for the output.
when HTTP_REQUEST {
log local0. "found uri: [HTTP::uri]"
if { [HTTP::uri] contains ".sdp" ||
[HTTP::uri] contains ".3gp" ||
[HTTP::uri] contains ".mov" ||
[HTTP::uri] contains ".mp4" } {
log local0. "Using Sun_Stream_Servers"
pool Sun_Stream_Servers
} else {
log local0. "Using Real_Stream_Servers"
pool Real_Stream_Servers
}
}
You could probably optimize this further by slapping the extensions in a string data group and use the findclass command. But for only a few extensions this is still manageable.
-Joe