Filters for Categorizing Sections in the Configuration

You can filter commands by using regular expressions. Filter highlights required configuration lines accordingly based on the following parameters:

Note:Level of a command represents the hierarchy of the configuration command.

Filter Pattern

A filter pattern is a list of section-aware configuration commands that can match the configuration on the device. It may contain the following wild-cards:
  • The wild-card * matches anything (non-negative number of characters) in their commands. Commands are allowed to have multiple * in the same filter line as well.
  • The wild-card $ is a special command that is used to match an entire block of commands under the command matched till the previous level.
Note:
  • CVP wild-cards are different from regular expression wild-cards. Filter pattern doesn’t support regular expressions.
  • A filter selects the whole block (all nested commands and sub-modes) from configuration which matches the last command string in the filter spec at that particular level.

Relative Order of Blocks in Filter Pattern

Filter Pattern Matched Configuration
*ip *
ip routing
no ip routing
transceiver*

$

transceiver qsfp default-mode 4x10G 
 load-balance policies
load-balance sand profile Orange
 no fields mac
 no fields mplsfields symmetric-hash
transceiver *

load-balance policies

 load-balance policies
load-balance sand profile Orange
 no fields mac
 no fields mplsfields symmetric-hash

The order of the patterns at the same level is irrelevant. Hence the following filters are equivalent.

Note: $ should be the last character in a configuration block. That is, adding commands after $ inside the block triggers an error.
Filter 1 Filter 2 Filter 3
transceiver*
 load* 

Interface Management1
 ip *
 ipv6 *
Interface Management1
 ip *
 ipv6 *

transceiver*
 load*
Interface Management1
 ipv6 *
 ip *

transceiver*
 load* 

Filter Type

A filter can be either managed or unmanaged.

For more information, refer to:

Specific Filters

When multiple filters are applied for matching specified configuration lines, the filter with maximum levels specified is chosen for comparison.
Note: CVP highlights the managed lines in yellow and unmanaged lines in grey. In the example below, the bold text represents managed lines and the italic text represents unmanaged lines.
Filter 1 (Managed) Filter 2 (Unmanaged)

transceiver*

$

transceiver*

load-balance*

Here, Filter 1 has only 1 level of command in the pattern whereas Filter 2 has 2 levels of command.

Note: $ is a special character and is not counted as a command. In other words, Filter 2 matches a more specific set of lines as shown below.
Configuration
transceiver qsfp default-mode 4x10G 
 load-balance policies
load-balance sand profile Orange
 no fields mac
Matched configuration for Filter 1
transceiver qsfp default-mode 4x10G 
 load-balance policies
load-balance sand profile Orange
 no fields mac
Matched configuration for Filter 2
 load-balance policies
load-balance sand profile Orange
 no fields mac

Thus, the combined result of the two filters would be:

transceiver qsfp default-mode 4x10G 
 load-balance policies
load-balance sand profile Orange
 no fields mac

Conflicting Filters

When two filters of different types match the same line and neither of them is more specific, they are said to be conflicting filters.

Note: CVP highlights the managed lines in yellow and unmanaged lines in grey. In the example below, the bold text represents managed lines and the italic text represents unmanaged lines.
Filter 1 (Managed) Filter 2 (Unmanaged) Configuration

transceiver*

load*

transceiver*

load-balance*

transceiver qsfp default-mode 4x10G 
 load-balance policies
load-balance sand profile Orange
 no fields mac

These filters have conflicting patterns load* and load-balance*. CVP displays an error when conflicting filters are assigned to devices. If conflicting filters are assigned to a device, you must correct all filters for applying them correctly to the device.