Forum Discussion
iRule Syntax Requirement for Data Group Names
err local/tmm3 tmm3[7053] 01220001 TCL error: rewrite_mstatic-irule - ambiguous option "-": must be -all, -index, -element, -name, or -value while executing "class match [string tolower [HTTP::header User-Agent]] contains non_mobi_ua"
I had never before received this error in testing or in the millions of prior executions. Then today, I received 51 failures, all with that same err msg. They stopped as abruptly as they started.
Doing some research, I found SOL10745 (Click Here) that states that when special chars are used in the DG entries, the DG name must be enclosed in braces within the iRule. I do have two DG entries that have special chars (one of which uses a "-").
As a test, I applied a dev version of the same iRule to a dev vs, then targeted the vs while spoofing the UA with only a "-" as the value. Even with the DG name wrapped in braces, I was still able to duplicate the err. Shouldn't this cause the iRule to not match since there is no DG entry that matches "-"? Instead, the connection is just dropped. The intended behavior when not matched is just to pass through to the pool.
- hoolio
Cirrostratus
Hi Anthony,RULE_INIT { log local0. "[class match -value "-lookup_string" equals $my_class]" }
RULE_INIT { log local0. "[class match -value -- "-lookup_string" equals $my_class]" }
-- Terminates option processing (useful if the or begins with a hyphen).
- Anthony_Hatch_3
Nimbostratus
Thanks for your assistance Aaron! Implementing this change has resolved the issue. My statement now reads: - Colin_Walker_12Historic F5 AccountAnthony,
- Anthony_Hatch_3
Nimbostratus
Thanks Colin! That's a good point. There are two other special chars in that particular DG, so I'll certainly maintain that syntax. Appreciate the pointers guys. - Colin_Walker_12Historic F5 AccountSure thing man, let us know if you've got any other questions.
- hoolio
Cirrostratus
The double hyphen terminates the flags passed to a command. The curly braces only escape special characters in the name of the datagroup--not in the names of the elements. - Anthony_Hatch_3
Nimbostratus
I see. I misread that in the article. Thanks for clearing that up. :)
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