Forum Discussion
ambiguous option "-" in switch
switch -glob [HTTP::header "User-Agent"] { "*x*" - "*y*" - "*z*" { if {!([HTTP::cookie exists "ccc"]) or !([HTTP::cookie exists "jjj"])} { if {[HTTP::uri] contains "ooo"} { return } else { if {[HTTP::cookie exists "aaa"]} { if {[HTTP::cookie value "aaa"] eq "zzz"} { return } }
I met this issue when apply this irule to vip
Mar 2 00:19:07 slot2/tmm2 err tmm2[5253]: 01220001:3: TCL error:xxx-redirect - ambiguous option "-": must be -exact, -glob, -regexp, or -- while executing "switch -glob [HTTP::header "User-Agent"] { "*x*" - "*y*" - "*z*" { if {!([HTTP::cookie exists "ccc"]) or !([HTTP::cookie exists "jjj"])}......
which stuff trigger this issue?
3 Replies
- hoolio
Cirrostratus
If the string you're checking starts with a hyphen it will be mis-interpreted as an option for switch. You can avoid this by using the -- option to terminate the options: - Robert_47833
Altostratus
great thx - funkdaddy_31014
Nimbostratus
I see this message in our logs as well, and it brought up a question - what happens to the request when this error occurs? Does it exit the iRule? Sends a RESET? Closes the connection?
Thanks, -funkdaddy
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