Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

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

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.

Cisco Employee

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

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.

New Member

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

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.