ON THIS PAGE
Filtering Operational Command Output
The pipe |
symbol lets you (the network administrator) filter the
command output in both operational and configuration modes.
About Using the Pipe ( | ) Symbol to Filter Command Output
You can filter command output by adding the pipe ( |
) symbol when you enter the
command.
Example:
user@host> show rip neighbor ?
Possible completions:
<[Enter]> Execute this command
<name> Name of RIP neighbor
instance Name of RIP instance
logical-system Name of logical system, or 'all'
| Pipe through a command
The following example lists the filters that you can use with the pipe symbol ( | ):
user@host> show interfaces | ?
user@host> show interfaces | ?
Possible completions:
append Append output text to file
count Count occurrences
display Show additional kinds of information
except Show only text that does not match a pattern
find Search for first occurrence of pattern
hold Hold text without exiting the --More-- prompt
last Display end of output only
match Show only text that matches a pattern
no-more Don't paginate output
refresh Refresh a continuous display of the command
request Make system-level requests
resolve Resolve IP addresses
save Save output text to file
tee Write to standard output and file
trim Trim specified number of columns from start of line
For the show configuration
command only, you can combine the pipe symbol and
question mark to display an additional compare filter:
user@host> show configuration | ?
Possible completions:
compare Compare configuration changes with prior version
...
You can enter any of the pipe filters in combination. For example:
user@host>command | match regular-expression | save filename
This topic describes only the filters that you can use for operational mode command output.
Example: Use Regular Expressions with the Pipe ( | ) Symbol to Filter Command Output
You use the except
, find
, and match
filters with the pipe symbol to employ regular expressions to filter output. Juniper Networks
uses the regular expressions as defined in POSIX 1003.2. If a regular expression contains
spaces, operators, or wildcard characters, enclose the expression in quotation marks.
Operator |
Function |
---|---|
|
Indicates that a match can be one of the two terms on either side of the pipe. |
|
Used at the beginning of an expression to denote where a match should begin. |
|
Used at the end of an expression to denote that a term must be matched exactly up to the point of the $ character. |
|
Specifies a range of letters or digits to match. To separate the start and end of a
range, use a hyphen ( |
|
Specifies a group of terms to match. |
For example, if a command produces the following output:
user@host> show chassis hardware Hardware inventory: Item Version Part number Serial number Description Chassis JN0000000AJD JNP10003-160C [PTX10003-160C] Routing Engine 0 Control Board FPC 1 BUILTIN BUILTIN FPC-JNP10003-LOGICAL PIC 0 BUILTIN BUILTIN 4x400G/10x200G/20x100G Xcvr 0 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 1 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 2 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 3 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 4 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 5 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 6 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 7 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 8 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 9 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 PIC 1 BUILTIN BUILTIN 4x400G/10x200G/20x100G Xcvr 0 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 1 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 2 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 3 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 4 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 5 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 6 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 7 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 8 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 9 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 SIB 0 BUILTIN BUILTIN SIB-JNP10003 SIB 1 BUILTIN BUILTIN SIB-JNP10003
A pipe filter of | match "PIC"
displays the following
output:
PIC 0 BUILTIN BUILTIN 4x400G/10x200G/20x100G PIC 1 BUILTIN BUILTIN 4x400G/10x200G/20x100G
A pipe filter of | except "PIC"
displays the following
output:
Hardware inventory: Item Version Part number Serial number Description Chassis JN0000000AJD JNP10003-160C [PTX10003-160C] Routing Engine 0 Control Board FPC 1 BUILTIN BUILTIN FPC-JNP10003-LOGICAL Xcvr 0 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 1 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 2 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 3 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 4 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 5 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 6 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 7 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 8 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 9 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 0 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 1 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 2 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 3 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 4 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 5 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 6 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 7 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 8 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 Xcvr 9 REV 01 740-058732 1DJQA042004 QSFP-100GBASE-LR4 SIB 0 BUILTIN BUILTIN SIB-JNP10003 SIB 1 BUILTIN BUILTIN SIB-JNP10003
Example: Pipe ( | ) Filter Functions in the Command-Line Interface
This topic describes and provides examples of the pipe ( | ) filter functions that the Junos OS Evolved CLI supports.
- Examples of Configurations and Their Differences in Text
- Examples of Configurations and Their Differences in XML
- Example of Counting the Number of Lines of Output
- Example of Output Displayed in XML Tag Format
- Example of Displaying Static Configuration Data
- Example of Displaying Output in JSON Format
- Example of Displaying the Configuration with YANG Translation Scripts Applied
- Example of Displaying the RPC Tags for a Command
- Example of Ignoring Output That Does Not Match a Regular Expression
- Example of Displaying Output from the First Match of a Regular Expression
- Example of Retaining Output After the Last Screen
- Example of Displaying Output Beginning with the Last Entries
- Example of Displaying Output That Matches a Regular Expression
- Example of Preventing Output from Being Paginated
- Example of Sending Command Output to Other Users
- Example of Resolving IP Addresses
- Example of Saving Output to a File
- Example of Appending Output to a File
- Example of Displaying Output on Screen and Writing to a File
- Example of Trimming Output by Specifying the Starting Column
- Example of Refreshing the Output of a Command
Examples of Configurations and Their Differences in Text
The compare
filter compares the candidate configuration with either
the current committed configuration or a configuration file. It also displays the
differences between the two configurations with text characters.
To compare configuration files, you enter compare
after the pipe ( |
) symbol, as follows:
show | compare [rollback n | filename]
The rollback
n variable is the index into the list of previously committed
configurations. The most recently saved configuration is 0. If you do not specify
arguments, the candidate configuration is compared against the active configuration
file (/config/juniper.conf), which is the same as comparing to
rollback
index 0.
The full path (or URL) to a configuration file is filename.
The comparison output uses the following conventions:
-
Statements that are in the candidate configuration only are prefixed with a plus sign (+).
-
Statements that are in the comparison file only are prefixed with a minus sign (–).
-
Statements that are unchanged are prefixed with a single blank space ( ).
Example:
user@host> show configuration system | compare rollback 9
[edit system]
+ host-name device;
+ backup-router 192.168.71.254;
- ports {
- console log-out-on-disconnect;
- }
[edit system name-server]
+ 172.17.28.11;
172.17.28.101 { ... }
[edit system name-server]
172.17.28.101 { ... }
+ 172.17.28.100;
+ 172.17.28.10;
[edit system]
- scripts {
- commit {
- allow-transients;
- }
- }
+ services {
+ ftp;
+ rlogin;
+ rsh;
+ telnet;
+ }
We have enhanced output from the show | compare
command to more
accurately reflect configuration changes. This enhancement includes more intelligent
handling of order changes in lists. For example, consider group names that are
reordered as follows:
[edit groups] - group_xmp; - group_cmp; - group_grp;
In early releases, output from the show | compare
command looked
like the following:
[edit groups] - group_xmp; - group_cmp; - group_grp; + group_xmp; + group_grp; + group_cmp;
Now, output from the show | compare
command looks like the
following:
[edit groups] group_xmp {...} ! group_grp {...}
Examples of Configurations and Their Differences in XML
The compare | display xml
filter compares the candidate
configuration with the current committed configuration and displays the differences
between the two configurations in XML. To compare configurations, you enter
compare | display xml
after the pipe ( | ) symbol in either
operational or configuration mode.
Example in operational mode:
user@host> show configuration | compare | display xml
Example in configuration mode:
[edit]
user@host# show | compare | display xml
You can enter a specific configuration hierarchy before using the |
compare
command. In configuration mode, you can navigate to a hierarchy
where the command is applied.
Example of Counting the Number of Lines of Output
To count the number of lines in command output, enter count
after
the pipe symbol ( | ). For example:
user@host> show configuration | count
Count: 269 lines
Example of Output Displayed in XML Tag Format
To display command output in XML tag format, you enter display xml
after the pipe symbol ( | ).
The following example displays the show cli directory
command output
as XML tags:
user@host> show cli directory | display xml
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/21.2R0/junos">
<cli>
<working-directory>/var/home/regress</working-directory>
</cli>
<cli>
<banner></banner>
</cli>
</rpc-reply>
If the configuration data or command output contains characters that are outside of the 7-bit ASCII character set, the CLI displays the equivalent UTF-8 decimal character reference for those characters in the XML output.
Example of Displaying Static Configuration Data
You can view the inherited configuration data and information about the source group
from which the configuration has been inherited with respect to the static
configuration database. To view this data, you issue the show configuration
| display inheritance
command.
user@host> show configuration | display inheritance
## Last commit: 2018-03-29 15:54:17 PDT
version 16.2R2;
system {
...
}
Example of Displaying Output in JSON Format
You can display the configuration or command output in JavaScript Object Notation
(JSON) format by entering display json
after the pipe symbol ( |
).
The following example displays the show cli directory
command output
in JSON format:
user@host> show cli directory | display json
{
"cli" : [
{
"working-directory" : [
{
"data" : "/var/home/username"
}
]
}
]
}
If the operational command output contains characters that are outside of the 7-bit ASCII character set, the CLI displays the equivalent UTF-8 decimal character reference for those characters in the JSON output.
Example of Displaying the Configuration with YANG Translation Scripts Applied
You can load YANG modules onto devices running Junos OS Evolved to augment the configuration hierarchy with data models that Junos OS Evolved does not support natively. Junos OS Evolved does support translation of these models.. The active configurations and candidate configurations contain the configuration data for non-native YANG data models in the syntax defined by that model. These configurations do not explicitly display the corresponding translated Junos OS Evolved syntax, which is committed as a transient change.
The | display translation-scripts
filter displays the complete
post-inheritance configuration, with the translated configuration data from all
enabled translation scripts explicitly included in the output. To display the
configuration with all enabled YANG translation scripts applied, append the
| display translation-scripts
filter to the show
configuration
command in operational mode or the show
command in configuration mode. For example:
user@host> show configuration | display translation-scripts
To view just the non-native configuration data after translation, you use the
| display translation-scripts translated-config
filter in
either operational mode or configuration mode.
user@host> show configuration | display translation-scripts translated-config
In configuration mode, you can display just the configuration
differences in the hierarchies corresponding to non-native YANG data models before
or after translation scripts are applied. To display those differences, you append
the configured-delta
, translated-config
, or
translated-delta
keyword, respectively, to the show |
display translation-scripts
command. In these cases, the XML output
displays the deleted configuration data, followed by the new configuration data.
user@host# show | display-translation-scripts (configured-delta | translated-config | translated-delta)
The following example displays a sample configuration with and without translation
scripts applied. The show
command displays the configuration, which
includes the non-native configuration data in the syntax that the YANG data model
defines. The | display translation-scripts
filter displays the
non-native configuration data in both the syntax defined by the YANG data model and
the translated Junos OS Evolved syntax. Both commands display the
entire configuration, which has been truncated for brevity in this example. However,
the show
command returns the pre-inhertitance configuration,
whereas the show | display translation-scripts
command returns the
post-inheritance configuration.
user@host# show
...
myint:intconfig {
interfaces {
interface et-0/0/0 {
config {
description test;
}
}
}
}
...
user@host# show | display translation-scripts
...
interfaces {
et-0/0/0 {
description test;
gigether-options {
no-flow-control;
}
}
}
...
myint:intconfig {
interfaces {
interface et-0/0/0 {
config {
description test;
}
}
}
}
...
Example of Displaying the RPC Tags for a Command
To display the remote procedure call (RPC) XML tags for an operational mode
command, you enter display xml rpc
after the pipe symbol
( | ).
The following example displays the RPC tags for the show route
command:
user@host> show route | display xml rpc
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/10.1I0/junos">
<rpc>
<get-route-information>
</get-route-information>
</rpc>
<cli>
<banner></banner>
</cli>
</rpc-reply>
Example of Ignoring Output That Does Not Match a Regular Expression
To ignore text that matches a regular expression, specify the except
command after the pipe symbol ( | ). If the regular expression contains any
spaces, operators, or wildcard characters, enclose it in quotation marks.
The following example displays all users who are logged in to the router, except for
the user root
:
user@host> show system users | except root
8:28PM up 1 day, 13:59, 2 users, load averages: 0.01, 0.01, 0.00
USER TTY FROM LOGIN@ IDLE WHAT
user p0 device1.example.com 7:25PM - cli
Example of Displaying Output from the First Match of a Regular Expression
To display output starting with the first occurrence of text matching a regular
expression, you enter find
after the pipe symbol ( | ). If the
regular expression contains any spaces, operators, or wildcard characters, enclose
it in quotation marks.
The following example displays the routes in the routing table starting at IP address
208.197.169.0
:
user@host> show route | find 208.197.169.0
208.197.169.0/24 *[Static/5] 1d 13:22:11
> to 192.168.4.254 via et-3/0/0.0
224.0.0.5/32 *[OSPF/10] 1d 13:22:12, metric 1
iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
47.0005.80ff.f800.0000.0108.0001.1921.6800.4015.00/160
*[Direct/0] 1d 13:22:12
> via lo0.0
The following example displays the first CCC entry in the forwarding table:
user@host> show route forwarding-table | find ccc
Routing table: ccc
MPLS:
Interface.Label Type RtRef Nexthop Type Index NhRef Netif
default perm 0 rjct 3 1
0 user 0 recv 5 2
1 user 0 recv 5 2
32769 user 0 ucst 45 1 et-0/0/0.534
et-0/0/0. (CCC) user 0 indr 44 2
10.0.16.2 Push 32768, Push
Example of Retaining Output After the Last Screen
You can retain output and scroll or search through it by holding rather than
returning immediately to the CLI prompt after viewing the last screen of output. To
retain output, you enter hold
after the pipe symbol ( | ). The
following example prevents returning to the CLI prompt after you have viewed the
last screen of output from the show
log log-file-1
command:
user@host> show log log-file-1 | hold
Example of Displaying Output Beginning with the Last Entries
You can view log files in which the end of the file contains the most recent entries.
To display text starting from the end of the output, you enter last
<
lines
>
after the pipe symbol ( | ).
The following example displays the last entries in log-file-1 file:
user@host> show log log-file-1 | last
When the number of lines requested is less than the number of lines that the screen length setting permits you to display, the system returns a subset. The system returns as many lines as permitted by the screen length setting. That is, if your screen length is set to 20 lines and you have requested only the last 10 lines, the system returns the last 19 lines instead of the last 10 lines.
Example of Displaying Output That Matches a Regular Expression
To display output that matches a regular expression, you enter
match
regular-expression
after the pipe symbol ( | ). If the regular expression contains any spaces,
operators, or wildcard characters, enclose it in quotation marks.
The following example matches all the 10-Gigabit Ethernet (xe) interfaces in the configuration:
user@host> show configuration | match xe-
xe-2/1/0 {
xe-2/1/1 {
xe-2/2/0 {
xe-5/2/0 {
xe-5/3/0 {
Example of Preventing Output from Being Paginated
By default, if output is longer than the length of the terminal screen, you receive a
---(more)---
message to display the remaining output. To
display the remaining output, you press Space.
To prevent the output from being paginated, you enter no-more
after
the pipe symbol ( | ).
The following example displays output from the show configuration
command all at once:
user@host> show configuration | no-more
This feature is useful if you want to copy the entire output and paste it into an email message.
Example of Sending Command Output to Other Users
To display command output on the terminal of a specific user logged in to your
router, or on the terminals of all users logged in to your router, you enter
request
message (all | user
account
@
terminal
)
after the pipe symbol ( | ).
If you are troubleshooting your router and talking with a customer service
representative on the phone, you can share the command output. You use the
request message
command to send your representative the command
output you are currently viewing on your terminal.
The following example sends the output from the show interfaces
command that you enter on your terminal to the terminal of the user
root@ttyp1
:
user@host> show interfaces | request message user root@ttyp1
The user root@ttyp1
sees the following output appear on the terminal
screen:
Message from user@host on /dev/ttyp0 at 10:32 PST... Physical interface: dsc, Enabled, Physical link is Up Interface index: 5, SNMP ifIndex: 5 Type: Software-Pseudo, MTU: Unlimited...
Example of Resolving IP Addresses
In operational mode only, if the output of a command displays an unresolved IP
address, you can enter | resolve
after the command to display the
name associated with the IP address. The resolve
filter enables the
system to perform a reverse DNS lookup of the IP address. If DNS is not enabled, the
lookup fails and no substitution is performed.
To perform a reverse DNS lookup of an unresolved IP address, you enter
resolve <full-names>
after the pipe symbol ( | ). If you
do not specify the full-names
option, the name is truncated to fit
whatever field width limitations apply to the IP address.
The following example performs a DNS lookup on any unresolved IP addresses in the
output from the show ospf neighbors
command:
user@host> show ospf neighbors | resolve
Example of Saving Output to a File
When command output is lengthy, when you need to store or analyze the output, or when you need to send the output in an e-mail message or by FTP, you can save the output to a file. By default, the file is placed in your home directory on the router.
To save command output to a file, you enter save
filename
after the pipe symbol ( | ).
The following example saves the output from the request support
information
command to a file named
my-support-info.txt:
user@host> request support information | save my-support-info.txt
Wrote 1143 lines of output to ‘my-support-info.txt’
Example of Appending Output to a File
When command output is displayed, you can either save the output to a file, which overwrites the existing contents of that file, or you can append the output text to a specific file.
To append the command output to the file, you enter append
filename
after the pipe symbol ( | ).
The following example appends the output from the request support
information
command to a file named
my-support-info.txt:
user@host> request support information | append my-support-info.txt
Wrote 2247 lines of output to 'my-support-info.txt'
Example of Displaying Output on Screen and Writing to a File
When command output is displayed, you can also write the output to a file. To both
display the output and write it to a file, you enter tee
filename
after the pipe symbol (|).
The following example displays the output from the show
interfaces et-* terse
command (displaying information about the status
of the Gigabit Ethernet interfaces on the device) and diverts the output to a file
called et-interfaces.txt:
user@host> show interfaces et-* terse | tee et-interfaces.txt
Interface Admin Link Proto Local Remote
et-0/1/0 up down
et-0/1/1 up up
et-0/1/2 up down
et-0/1/3 up up
Unlike the UNIX tee
command, only an error message is displayed if
the file cannot be opened (instead of displaying the output and then the error
message).
user@host> show interfaces et-* terse | tee /home/user/test.txt
error: tee failed: file /home/user/test.txt could not be opened
user@host>
Example of Trimming Output by Specifying the Starting Column
Output appears on the terminal screen in terms of rows and columns. The first
alphanumeric character starting at the left of the screen is in column 1, the second
character is in column 2, and so on. To display output starting from a specific
column (thus trimming the leftmost portion of the output), you enter trim
columns
after the pipe symbol ( | ). The trim
filter
is useful for trimming the date and time from the beginning of system log
messages.
The following example displays output from the show system storage
command, filtering out the first 10 columns:
user@host> show system storage | trim 11
The trim
command does not accept negative values.
Example of Refreshing the Output of a Command
You can run an operational mode command with the | refresh
pipe
option to refresh the output displayed on the screen periodically. The default
refresh occurs every second. However, you can also explicitly specify a refresh
interval from 1 through 604,800 seconds. For example, to refresh the output of the
show interfaces
command every 5 seconds, you run the following
command:
user@host> show interfaces | refresh 5
Use Suppress-Zero Filter with the Pipe ( | ) Symbol to Filter Zero Values in Command Output
Junos OS supports suppress-zero
filter to exclude lines with ‘0' values for
any of the fields in given line. This feature is available for all the operational show
commands. For show commands CLI output, lines with ‘0’ values output can be masked. The output
lines with non-zero values are displayed. You can use this to mask zero counters’ values. If a
line has non-zero values along with ‘0’ values in a line, it is not masked. If ‘0’ appears in
description or string field, it is not masked and is emitted in the CLI output.
This feature is applicable for CLI operational commands only. The
suppress-zeros
filter is not applicable for commands that don't use
rendering. For example, show configuration
, traceroute
,
ping
and other monitor commands.
Here are a few examples for the show commands with suppress-zeroes
filter:
-
For example, if a command produces the following output:
user@host> show interfaces vtep Physical interface: vtep, Enabled, Physical link is Up Interface index: 133, SNMP ifIndex: 517 Type: Software-Pseudo, Link-level type: VxLAN-Tunnel-Endpoint, MTU: Unlimited, Speed: Unlimited Device flags : Present Running Interface flags: SNMP-Traps Link type : Full-Duplex Link flags : None Last flapped : Never Input packets : 0 Output packets: 0
A pipe filter of
| suppress-zeros
displays the following output:user@host> show interfaces vtep | suppress-zeros Physical interface: vtep, Enabled, Physical link is Up Interface index: 133, SNMP ifIndex: 517 Type: Software-Pseudo, Link-level type: VxLAN-Tunnel-Endpoint, MTU: Unlimited, Speed: Unlimited Device flags : Present Running Interface flags: SNMP-Traps Link type : Full-Duplex Link flags : None Last flapped : Never
In this example, the Input packets and Output packets fields are masked as these fields contain ‘0’ integer values.
-
If a command produces the following output:
user@host> show interfaces fxp0 Physical interface: fxp0, Enabled, Physical link is Up Interface index: 8, SNMP ifIndex: 1 Description: 0 Type: Ethernet, Link-level type: Ethernet, MTU: 1514, Speed: 1000mbps Device flags : Present Running Interface Specific flags: Internal: 0x100000 Interface flags: SNMP-Traps Link type : Full-Duplex Link flags : 0x4 Current address: 54:04:0a:dd:85:8d, Hardware address: 54:04:0a:dd:85:8d Last flapped : 2023-11-15 19:02:00 IST (21:40:35 ago) Input packets : 1530766 Output packets: 13469 Logical interface fxp0.0 (Index 5) (SNMP ifIndex 13) Flags: Up SNMP-Traps 0x4000000 Encapsulation: ENET2 Input packets : 1528251 Output packets: 13481 Protocol inet, MTU: 1500 Max nh cache: 75000, New hold nh limit: 75000, Curr nh cnt: 186, Curr new hold cnt: 0, NH drop cnt: 0 Flags: Sendbcast-pkt-to-re, Is-Primary Addresses, Flags: Is-Preferred Is-Primary Destination: 10.221.128/18, Local: 10.221.133.141, Broadcast: 10.221.191.255
A pipe filter of
| suppress-zeros
displays the following output:user@host> show interfaces fxp0 | suppress-zeros Physical interface: fxp0, Enabled, Physical link is Up Interface index: 8, SNMP ifIndex: 1 Description: 0 Type: Ethernet, Link-level type: Ethernet, MTU: 1514, Speed: 1000mbps Device flags : Present Running Interface Specific flags: Internal: 0x100000 Interface flags: SNMP-Traps Link type : Full-Duplex Link flags : 0x4 Current address: 54:04:0a:dd:85:8d, Hardware address: 54:04:0a:dd:85:8d Last flapped : 2023-11-15 19:02:00 IST (21:40:35 ago) Input packets : 1530766 Output packets: 13469 Logical interface fxp0.0 (Index 5) (SNMP ifIndex 13) Flags: Up SNMP-Traps 0x4000000 Encapsulation: ENET2 Input packets : 1528251 Output packets: 13481 Protocol inet, MTU: 1500 Max nh cache: 75000, New hold nh limit: 75000, Curr nh cnt: 186, Curr new hold cnt: 0, NH drop cnt: 0 Flags: Sendbcast-pkt-to-re, Is-Primary Addresses, Flags: Is-Preferred Is-Primary Destination: 10.221.128/18, Local: 10.221.133.141, Broadcast: 10.221.191.255
In this example, the
Description
field is not masked in the output as it is a string type and is a non-integer. TheMax nh cache: 75000, New hold nh limit: 75000, Curr nh cnt: 186, Curr new hold cnt: 0, NH drop cnt: 0
line is not masked as it contains non-zero integer counter values in it.