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 stuff
}
"*users.txt" {
do stuff
How do i use Data Group lists in the example above?
Thanks
- YozzerNimbostratusif [HTTP::uri] contains allowed_urls
- hooleylistCirrostratusYou can use the class command to look up the URI to see if it's in the datagroup like Colin's example:
when HTTP_REQUEST { set action [class match -value [string tolower [HTTP::path]] equals allowed_urls] if {$action ne ""} do stuff } }
- YozzerNimbostratusHi Aaron
- hooleylistCirrostratusThe datagroup is always defined outside the iRule. You cannot define a datagroup within an iRule.
when HTTP_REQUEST { if {[matchclass [string tolower [HTTP::path]] equals allowed_urls]} do stuff } }
- YozzerNimbostratususing 9.4.8
- nitassEmployeecan u try this?
- YozzerNimbostratusThanks nitass
- nitassEmployeeoh yes, i missed the last }.
- YozzerNimbostratusThat all works fine apart from the contents of the lists.
- YozzerNimbostratusi think its the upper case letters it doesnt like as abc12-d34ef-ghj-kjn-fds is fine. Does anyone know what the number of values can be in a data group list?
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