Using the nspepi Tool to Convert Classic Expressions to Advanced Expressions

Using the nspepi Tool to Convert Classic Expressions to Advanced Expressions

book

Article ID: CTX131024

calendar_today

Updated On:

Description

The article contains information about the nspepi tool used to convert classic expressions to advanced expressions.

Nspepi Tool

The nspepi tool must be used from the shell prompt of the NetScaler appliance to convert classic policy expressions to advanced policy expressions. You can either use expressions or the complete ns.conf configuration file as an input to this tool.

A classic expression can be converted to the advanced expression syntax by using the nspepi conversion tool. In addition, the tool can be used to convert all the classic expressions in the NetScaler appliance configuration to the advanced syntax with the exception of NetScaler entities that currently support only classic expressions.
 

Syntax

nspepi (-e "classic expression" | -f "ns config file") (-v)
Max expression length = 1499

Output format of the syntax

<Converted advanced expression> | <Convertered ns config>
root@NS_220#

Output Format

A new configuration file is created with the name new_<input file name>. A new warning file is created with the name warn_<input file name>. New files are created in the same directory as the input file. Only the warnings are printed while executing without –v (verbose) option.

When you use the –v option, the modified configuration file is printed in standard output in addition with the new files.

Converting Expressions

Run the following command at the shell prompt of the appliance:
nspepi -e "<classic expression>"

root@NS-150# nspepi -e "REQ.HTTP.URLQUERY CONTAINS content=StoreSearchServices"

"HTTP.REQ.URL.QUERY.AFTER_STR(\"content=StoreSearchServices\").LENGTH.GT(0)"

Converting a NetScaler Configuration File

Run the following command to convert the ns.conf file to advanced policy expressions:
nspepi -f "<ns config file>" -v

root@NS-150# nspepi -f /nsconfig/ns.conf
OUTPUT: New configuration file created: /nsconfig/new_ns.conf
OUTPUT: New warning file created: /nsconfig/warn_ns.conf
WARNINGS: Total number of warnings due to bind commands: 2
WARNINGS: Line numbers which has bind command issues: 237, 290
root@NS-150#

Note :

The tool does not convert all classic policy expressions to advanced policy expressions when analyzing a configuration file. See the additional resources section below for details about policy expressions that are converted by the tool.  Additionally, the tool does not optimize the configuration, rather it creates equivalent files only. For better performance and to take full advantage of advanced syntax, you have to manually optimize after converting the file into advanced expressions.
 

 

Issue/Introduction

This article provides information on using the nspepi tool to convert classic expressions to advanced expressions.

Additional Information

Policy Configuration and Reference

Converting Classic Policy Expressions to Advanced Policy Expressions