Forum Discussion
irule creation with tmsh using switch option
Hi can any one tell me what wrong in this irule creation?
create ltm rule /Common/myrule when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] {"xyz-external-fin.test.com" { pool xyz-external-fin } "xyz-external-prj.test.com" { pool xyz-external-prj }default { discard } } }
it gives error "Syntax Error: Unexpected {"
Regards, Rajeev
2 Replies
- arpydays
Nimbostratus
I'm not sure you can put in a 1 liner rule like this and may need to drop to editor mode and paste in. You could also try putting this in via bash, note you need a space before default in your rule.
[root@f51:Active:Standalone] config tmsh create ltm rule /Common/myrule when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] {"xyz-external-fin.test.com" { pool xyz-external-fin } "xyz-external-prj.test.com" { pool xyz-external-prj } default { discard } } } [root@f51:Active:Standalone] config tmsh list ltm rule myrule ltm rule myrule { when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] {xyz-external-fin.test.com { pool xyz-external-fin } xyz-external-prj.test.com { pool xyz-external-prj } default { discard } } } } - mo_99289Historic F5 Account
BIGIP doesn't support create irule by this way now. we already had bug to address this.
Users can create an iRule through an editor, from-terminal, or from a file.
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