-pattern parameter in the rewrite action was removed in 13.1

-pattern parameter in the rewrite action was removed in 13.1

book

Article ID: CTX575013

calendar_today

Updated On:

Description

When user configure rewrite action with pattern param in GUI or CLI in NS 13.1, below error may prompt: "ERRO: No such argument [-pattern]" 

e.g 


> add rewrite action rwa_insert_intra_captcha_ag insert_before_all "HTTP.RES.BODY(8000).SET_TEXT_MODE(IGNORECASE)" q{"<td></td><td></td><td align=\"right\"><iframe src=\"/jcaptcha/jcaptcha.jpg\" height=\"100\" width=\"250\" frameborder=\"0\"></iframe><img id=\"PageRefresh\" src=\"/jcaptcha/images/Refresh_32.png\" onclick=\"javascript:window.location.href=window.location.href;\"> " + "<br><input id=\"\" class=\"CTXMSAM_ContentFont\" style=\"font-size: 20px\" type=\"text\" title=\"\" name=\"tsmcJcaptcha\" size=\"30\" maxlength=\"127\" onFocus=\"loginFieldCheck()\"style=\"width:100%; color=black;\" /></tr><tr>"} -pattern "<td></td><td></td><td align=\"right\">"
ERROR: No such argument [-pattern]
Usage: add rewrite action <name> <type> <target> [<stringBuilderExpr>] [-search <expression>] [-refineSearch <expression>] [-comment <string>]

>

Environment

This software application is provided to you as is with no representations, warranties or conditions of any kind. You may use and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that: (a) the software application may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the software application fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the software application. In no event should the software application be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SOFTWARE APPLICATION, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the software application.

Resolution

The nspepi upgrade tool can be useful in converting your configuration , more detail check the documentation .

Use nspepi tool available at https://github.com/citrix/ADC-scripts/tree/master/nspepi for the most complete and up-to-date version.

For pattern parameter, please use "-search" instead.

e.g.

Pattern param:

add rewrite action rwa_insert_intra_captcha_ag insert_before_all "HTTP.RES.BODY(8000).SET_TEXT_MODE(IGNORECASE)" q{"<td></td><td></td><td align=\"right\"><iframe src=\"/jcaptcha/jcaptcha.jpg\" height=\"100\" width=\"250\" frameborder=\"0\"></iframe><img id=\"PageRefresh\" src=\"/jcaptcha/images/Refresh_32.png\" onclick=\"javascript:window.location.href=window.location.href;\"> " + "<br><input id=\"\" class=\"CTXMSAM_ContentFont\" style=\"font-size: 20px\" type=\"text\" title=\"\" name=\"tsmcJcaptcha\" size=\"30\" maxlength=\"127\" onFocus=\"loginFieldCheck()\"style=\"width:100%; color=black;\" /></tr><tr>"} -pattern "<td></td><td></td><td align=\"right\">"

Search param:

add rewrite action rwa_insert_intra_captcha_ag insert_before_all "HTTP.RES.BODY(8000).SET_TEXT_MODE(IGNORECASE)" q{"<td></td><td></td><td align=\"right\"><iframe src=\"/jcaptcha/jcaptcha.jpg\" height=\"100\" width=\"250\" frameborder=\"0\"></iframe><img id=\"PageRefresh\" src=\"/jcaptcha/images/Refresh_32.png\" onclick=\"javascript:window.location.href=window.location.href;\"> " + "<br><input id=\"\" class=\"CTXMSAM_ContentFont\" style=\"font-size: 20px\" type=\"text\" title=\"\" name=\"tsmcJcaptcha\" size=\"30\" maxlength=\"127\" onFocus=\"loginFieldCheck()\"style=\"width:100%; color=black;\" /></tr><tr>"} -search q{text("<td></td><td></td><td align=\"right\">")}

Problem Cause

The -pattern "<td></td><td></td><td align=\"right\">"parameter in the rewrite action was removed in 13.1