cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1068
Views
0
Helpful
2
Replies

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

calterio
Level 1
Level 1

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.

2 Replies 2

Joe Clarke
Cisco Employee
Cisco Employee

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 http://www.cisco.com/en/US/products/sw/iosswrel/ps5207/products_feature_guide09186a00801a75a7.html 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 http://www.cisco.com/en/US/products/hw/switches/ps708/products_configuration_guide_chapter09186a008019eff0.html#wp1038944 for tips on using TCL on CatOS.

Paul Williams
Level 1
Level 1

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.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco