06-08-2018 07:55 AM - edited 03-08-2019 03:18 PM
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
Solved! Go to Solution.
06-08-2018 08:06 AM
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
06-08-2018 08:16 AM
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
06-08-2018 08:06 AM
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
06-08-2018 08:07 AM
that has narrowed it down a bit. is it possible to show interfaces were all columns are zero only?
06-08-2018 08:16 AM
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
06-08-2018 08:18 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide