cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
944
Views
0
Helpful
4
Replies

Regex pattern to show counters at zero "0"?

Alex Willoughby
Level 1
Level 1

Good afternoon,

 

im trying to get an regex pattern to show counters that are set to 0 on some catalyst switches.

 

so far ive tried

 

#sh interfaces counters | i _0^
#sh interfaces counters | i .0^
#sh interfaces counters | i $0^

but they all return nothing, from the below sample:

Gi1/0/29           17663            101             26              0
Gi1/0/30          807366           2667             42              7
Gi1/0/31               0              0              0              0
Gi1/0/32         3253549          12569             33              8
Gi1/0/33           17527            101             25              0
Gi1/0/34           17901            104             25              0
Gi1/0/35          192500           1231             10              0
Gi1/0/36           17663            101             26              0
Gi1/0/37           17119             93             26              0
Gi1/0/38               0              0              0              0
Gi1/0/39         3816293           8715             32              5

id hope to return g1/0/38 and g1/0/31

 

can someone help me out with this pattern?

Thanks

2 Accepted Solutions

Accepted Solutions

Jon Marshall
Hall of Fame
Hall of Fame

 

Depends on exactly what you need. 

 

So '#sh int counters | inc _0_' will show any line with a 0 in any of the columns if that is what you are looking for ? 

 

Jon

View solution in original post

 

You can just cut and paste a line from the output eg. 

 

#sh int counters | inc <paste one of the lines you want to see>

 

Jon

 

View solution in original post

4 Replies 4

Jon Marshall
Hall of Fame
Hall of Fame

 

Depends on exactly what you need. 

 

So '#sh int counters | inc _0_' will show any line with a 0 in any of the columns if that is what you are looking for ? 

 

Jon

that has narrowed it down a bit. is it possible to show interfaces were all columns are zero only?

 

You can just cut and paste a line from the output eg. 

 

#sh int counters | inc <paste one of the lines you want to see>

 

Jon

 

didn't think of that! the simplest solution is often right in front of you! Thanks Jon
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: