Forum Discussion
Yozzer
Jun 03, 2011Nimbostratus
Data Group List use in a switch
Hi
I have a Data Group list called allowed_urls that has a list of accepted urls which i want to use in an irule.
switch -glob [HTTP::uri] {
"*temp.txt" {
do...
Colin_Walker_12
Jun 06, 2011Historic F5 Account
More realistically what you want to do is set up an action for each file type. If that's the case, then make sure the action is associated with the file type in the data group.
For instance:
class allowed_urls {
"temp.txt" {"action1"}
"users.txt" {"action2"}
}
etc.
Then you'd just need some code to act upon those things:
when HTTP_REQUEST {
set action [class match -value [string tolower [HTTP::uri]] equals allowed_urils]
if {$action ne ""}
do stuff $action
}
}
The only tricky part there is knowing which commands to use with the "$action" variable. I'm assuming they're all going to be similar actions though, like executing the pool command or something.
Colin
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