Forum Discussion
yves_werniers_1
Nimbostratus
Jun 08, 2010irule stream::exporession and data group list
Hello,
I would like to rewrite responses from webservers to add a part to the url (in certain cases). Is it possible to use the stream::expression with data group lists? Like that, I could m...
Jun 08, 2010
Another option would be to store the expressions each as a single entry in the string data group
class stream_expressions {
{
"@five@six@"
"@nine@ten@"
"@one@two@"
"@seven@eight@"
"@three@four@"
}
}Then you could do something like this to pull each one out and append it to a string and use that for the expression
set expressions [class get stream_expressions]
set se ""
foreach {re} $expressions {
append se [lindex $re 0]
}
if { [llength se] > 0 } {
STREAM::expression $se;
} else {
STREAM::disable;
}
}Of course, you could just store the entire concatenated string as a single entry as well and that would save on some string allocations. The class would look something like this
class stream_expressions {
"@one@two@@three@four@@five@six@@seven@eight@@nine@ten@"
}And the iRule could be like
set se [lindex [class element 0 stream_expressions] 0];
if { [llength se] > 0 } {
STREAM::expression $se;
} else {
STREAM::disable;
}
}Hope this helps...
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
