filtering "SH PORT" or "SH INT" for only certain fields?

Unanswered Question
Apr 23rd, 2007
User Badges:

Is there a way to filter the output of the "sh port" (Cat) or "sh int" (ios) command so that I only get certain fields? There doesn't seem to be a "|incl" option for these commands. Is there another way? I want to see port, name, duplex, speed, align-err, fcs-err, and runts. We suspect mismatches on speed/duplex settings and want to reset counters, wait a day, then get this output on three 6509 switches (two cat-based, one ios-based). Any help would be appreciated. Thank you.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Joe Clarke Mon, 04/23/2007 - 08:58
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

If you have recent enough versions of CatOS and IOS, you have the ability to use TCL to code filters for the show port/show int commands. CatOS 8.x and IOS 12.2(18)SXF5 and higher give you this capability. See for more info on TCL in IOS. CatOS's TCL is not nearly as powerful, but it should be sufficient for filtering show port output. See for tips on using TCL on CatOS.

Paul Williams Tue, 04/24/2007 - 07:02
User Badges:

Using LMS and especially RME 4.0.5 I have used the NetShow functionality to do this.

Go NetShow>NetShow Jobs>Create

and then in the Custom Commands box, enter the command

sh port | include xxxx

where xxxx is the part you wish to filter on.

Its not perfect but it works.


This Discussion