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:
Filter Pattern
- 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.
- 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 * |
|
transceiver* $ |
|
transceiver * load-balance policies |
|
The order of the patterns at the same level is irrelevant. Hence the following filters are equivalent.
$
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 |
---|---|---|
|
|
|
Filter Type
A filter can be either managed or unmanaged.
Specific Filters
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.
transceiver qsfp default-mode 4x10G
load-balance policies
load-balance sand profile Orange
no fields mac
transceiver qsfp default-mode 4x10G
load-balance policies
load-balance sand profile Orange
no fields mac
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.
Filter 1 (Managed) | Filter 2 (Unmanaged) | Configuration |
---|---|---|
transceiver* load* |
transceiver* load-balance* |
|
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.