This article covers recognized quotation syntax for the advanced policy engine
Summary
The NetScaler CLI is a shell that interprets text input as commands, and some text characters are designated as "special" to enable certain functionality, for example:
The space and tab characters, Question mark, slash, backslash, single and double quotation all have specific meanings within the CLI.
To use policy expressions, which may include spaces and other special characters, we must syntactically identify the expressions unambiguously for the shell by using recognized escape characters to let the CLI know that the character should be treated as a character and not a special command.To date, we have frequently used a leading backslash character ("\") to indicate when a special character should not be interpreted by the shell.
As of NetScaler 8.0 we have a quotation syntax that will make the backslash unnecessary. Using the delimiting characters:
q/<expression>/
This will prevent the shell from interpreting any special characters in the enclosed expression. However, this isn't quite the whole story. After the leading lower-case Q, all printable non-alphanumeric characters can be delimiters, as long as they do not appear within the expression itself.
For example, all of the following choices are valid:
q/HTTP.REQ.URL.CONTAINS("_data=")/
q|HTTP.REQ.URL.CONTAINS("_data=")|
q#HTTP.REQ.URL.CONTAINS("_data=")#
q~HTTP.REQ.URL.CONTAINS("_data=")~
q[HTTP.REQ.URL.CONTAINS("_data=")] - additional paired delimters are {} <> You cannot use parentheses () for this purpose.
When the NetScaler prints these commands, e.g. to ns.conf, the result may not appear as the command was typed. The rules:
•If the string contains no control characters or spaces then no quotes are used
•Double quotes are used if the string contains control characters or spaces, but does not contain double quotes or other potential shell escape sequences. Control characters are replaced by escape sequences
If the string does not meet the above criteria, then q// syntax will be used
More Information