Filtering Cisco IOS Interface Traffic Rates Using CLI Regular Expressions

Filtering Cisco IOS Interface Traffic Rates Using CLI Regular Expressions

Cisco Interface Rates are typically buried inside of the show interfaces command output. However there are ways to filter in Cisco IOS and it is similar to the Linux CLI utility known as grep.

Have you ever needed to show a specific port’s rate – or show all ports at the same time? I know for me it’s hard to read all that output at the same time. It would be nice if there were a command just for showing interface rates but instead we have to filter out some of the output given to us by the stock IOS commands.

Here is a special little CLI one-liner that I use to show all interface input and output traffic rates at the same time:

cisco-ios
lab-cisco# show interfaces | in line_proto|input_ra|output_rate

This uses the tool include which is similar to the grep tool in Linux. I call it grep for Cisco IOS.

>_ Engineering Discussion 2 Comments

+ Add Field Note ↓
  1. show interfaces | include (line protocol|input rate|output rate) combined with load-interval 30 on the physical interfaces is my go-to one-liner whenever SNMP polling is too slow to catch microbursts on Cisco IOS-XE.

  2. Adding | exclude 0 bits/sec at the end of the regex pipeline is also super handy on 48-port access switches when you only want to see active ports carrying live traffic.

Leave a Technical Comment

Share CLI tips, hardware notes, or questions below. Inline backticks (`command`) are supported.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Engineering Notes