cancel
Showing results for 
Search instead for 
Did you mean: 

S/N/K-Series Search for Matching Output in 'show' commands

S/N/K-Series Search for Matching Output in 'show' commands

FAQ_User
Extreme Employee
Article ID: 14877

Products
S-Series
Matrix N-Series DFE
K-Series

Goals
Search for matching output in '
code:
show
' commands, similar to the use of the UNIX '
code:
grep
' parameter.
Use the pipe character to locate keywords in query command output.

Solution
Most '
code:
show
' commands are responsive to appending of the "
code:
|find
<
keyword
>" sequence, which provides filtering that has the effect of only displaying output lines that include the specified keyword string.

Here are some examples:

code:
N7(su)-
>
show config policy |find cos 6

code:
set policy profile 1 name QoS pvid-status enable pvid 4095 cos-status enable cos 6

code:
set policy rule 1 iptos 104 mask 8 forward cos 6

code:
set policy rule 1 iptos 184 mask 8 forward cos 6

code:
N7(su)-
>

code:
N7(su)-
>
show config all |find cos 6

code:
set policy profile 1 name QoS pvid-status enable pvid 4095 cos-status enable cos

code:
6 tci-overwrite disable precedence 1-8,12-19,21-22,25-28,31 clear-mirror syslog

code:
disable trap disable disable-port disable

code:
set policy rule 1 iptos 104 mask 8 storage-type non-volatile forward cos 6 syslo

code:
g disable trap disable disable-port disable tci-overwrite disable clear-mirror

code:
set policy rule 1 iptos 184 mask 8 storage-type non-volatile forward cos 6 syslo

code:
g disable trap disable disable-port disable tci-overwrite disable clear-mirror

code:
N7(su)-
>

code:
N5(su)-
>
show system hardware |find sdram

code:
SDRAM:
code:
256 MB

code:
SDRAM:
code:
256 MB

code:
SDRAM:
code:
256 MB

code:
N5(su)-
>

code:
N7(su)-
>
show port lacp port *.*.* status summary |find lag

code:
fe.1.22
code:
lag.0.1 [(32768,001188162793,32768),(32768,001f453d21aa,32768)]

code:
fe.1.24
code:
lag.0.1 [(32768,001188162793,32768),(32768,001f453d21aa,32768)]

code:
N7(su)-
>

code:
N7(su)-
>
show logging buffer |find ge.1.23

<
code:
165
>
code:
Dec 13 21:36:47 10.20.1.150 LinkTrap[1]Interface ge.1.23 is Up.

<
code:
165
>
code:
Dec 13 21:36:49 10.20.1.150 LinkTrap[1]Interface ge.1.23 is Down.

<
code:
165
>
code:
Dec 13 21:36:53 10.20.1.150 LinkTrap[1]Interface ge.1.23 is Up.

<
code:
165
>
code:
Dec 17 17:55:25 10.20.1.150 LinkTrap[1]Interface ge.1.23 is Down.

<
code:
165
>
code:
Dec 20 20:04:13 10.20.1.150 LinkTrap[1]Interface ge.1.23 is Up.

code:
N7(su)-
>

code:
S4(su)-
>
show router limits |find interfaces

code:
ip-interfaces 278 - - -

code:
lo-interfaces 1 - - -

code:
lpbk-interfaces 21 - - -

code:
vlan-interfaces 256 - - -

code:
S4(su)-
>

code:
S4(su-router)-
>
show ip ospf database |find 0.0.0.0

code:
Displaying LS Type 1 Advertisements (Area 0.0.0.0)

code:
Displaying LS Type 2 Advertisements (Area 0.0.0.0)

code:
Displaying LS Type 3 Advertisements (Area 0.0.0.0)

code:
Displaying LS Type 4 Advertisements (Area 0.0.0.0)

code:
0.0.0.0 140.161.254.1 398 800020c2 0xa4b4

code:
S4(su-router)-
>

Here are some pointers for use of this command feature:
  • It simply filters output lines not containing an exact match to the <
    keyword
    > string value. If that string value does not appear when the command is executed without "
    |find
    ", then there will be no output when the command is executed with "
    |find
    ".
  • None of the command menu system, including the help menus, make mention of it.
  • None of the official documentation, including manuals and release notes, make mention of it.
  • There is no list of commands that either support it or don't support it. If not supported for a particular '
    show
    ' command, then its inclusion with that command is simply ignored - no error message is generated.
  • The keyword is not case sensitive.
  • Do not add delimiters (e.g.
    ""
    ) to the keyword string, even if it includes spaces or special characters. Any included delimiters are assumed to be part of the keyword string value.
  • "
    |find
    " only works while CLI length is set to
    0
    (default). If "
    |find
    " is used while length is greater than
    0
    (e.g. '
    set length 24
    '), then both of these features are ignored during the '
    show
    ' command execution. This is a known shortcoming, effectively FAD. It may be resolved in a future firmware release.
Also see this HowTo Video which explains the use of the Find and Loop parameters.
0 REPLIES 0
GTM-P2G8KFN