
Chapter 1
Using the CLI String Search
Using the CLI String Search
The pattern in the command output is referred to as a string. The CLI string search feature allows you to search or filter any show or more command output and allows you to search and filter at
With the search function, you can begin unfiltered output at the first line that contains a regular expression that you specify. You can then specify a maximum of one filter per command or start a new search from the
A regular expression is a pattern (a phrase, number, or more complex pattern) that software uses to match against show or more command output. Regular expressions are case sensitive and allow for complex matching requirements. Examples of simple regular expressions are Serial, misses, and 138. Examples of complex regular expressions are 00210..., ( is ), and [Oo]utput.
You can perform three types of filtering:
•Use the begin keyword to begin output with the line that contains a specified regular expression.
•Use the include keyword to include output lines that contain a specified regular expression.
•Use the exclude keyword to exclude output lines that contain a specified regular expression. You can then search this filtered output at the
Note The CLI string search function does not allow you to search or filter backward through previous output; filtering cannot be specified using HTTP access to the CLI.
Regular Expressions
A regular expression can be a single character that matches the same single character in the command output or multiple characters that match the same multiple characters in the command output. This section describes how to create both
Single-Character Patterns
The simplest regular expression is a single character that matches the same single character in the command output. You can use any letter
Table
|
| Character | Special Meaning |
| |||
|
|
|
| ||||
. | Matches any single character, including white space. | ||||||
|
|
|
| ||||
* | Matches 0 or more sequences of the pattern. | ||||||
|
|
|
| ||||
+ | Matches 1 or more sequences of the pattern. | ||||||
|
|
|
| ||||
? | Matches 0 or 1 occurrences of the pattern. | ||||||
|
|
|
|
|
|
| |
|
|
| Catalyst 6500 Series Switch SSL Services Module Command Reference |
|
|
| |
|
|
|
| ||||
|
|
|
|
|
|
|
|
|
|
|
| ||||
|
|
|
| ||||