Forum Discussion
Websphere data group irule
I am in the process of implementing Websphere. There is an irule requirement that lists uris. Rather than list them specifically in the irule, I want to call them in a data group. I haven't been able to figure out how to appropriately call the dg though.
Here is the irule which is working without a dg.
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/a/" - "/b/" - "/c/*" { pool WEBSPHERE_POOL_9086 } default { HTTP::respond 200 content { Wrong URL } } } }
6 Replies
- Walter_Kacynski
Cirrostratus
I just implemented something similar to the following:
if {[class match [HTTP::uri] starts_with URL-DataGroup]} { pool WEBSPHERE_POOL_9086 } else } HTTP::respond 200 content { Wrong URL } } - mlick2
Nimbostratus
I have tried the following; but get the TCL error when the rule is hit and am unable to access the site at all
01220001:3: TCL error: /Common/WEBSPHERETEST2 - invalid command name "}" while executing "}"
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] if{[class match [HTTP::uri] starts_with URL_DATAGROUP] { pool WEBSPHERE_POOL_9086 } else { HTTP::respond 200 content { Wrong URL } } } } - Walter_Kacynski
Cirrostratus
Why are you trying to use a switch statement? The Datagroup is essentially an externalized switch. Did you try the syntax as I wrote originally? I'm not sure if it works for your case exactly.
- Walter_Kacynski
Cirrostratus
Also, I do TCL prototyping with this site: http://codepad.org/
It's good for syntax and runtime validation but you have to adapt to and remove the F5 specific commands.
- mlick2
Nimbostratus
The switch statement was in the Websphere deployment guide. I had removed almost everything in the rule and it still wasn't working with what is below
when HTTP_REQUEST { if{[class match [string tolower [HTTP::uri]] starts_with URL_DATAGROUP] { pool WEBSPHERE_POOL_9086 } } }- shaggy
Nimbostratus
one issue i see - you're missing a } after DATAGROUP ], and there's an extra } at the end - should look like: when HTTP_REQUEST { if{[class match [string tolower [HTTP::uri]] starts_with URL_DATAGROUP]}{ pool WEBSPHERE_POOL_9086 } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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