cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
14722
Views
14
Helpful
4
Replies

count line output on ios cli

Neetu Bhushan
Level 1
Level 1

hi all,

i'd like to count my "sh ip dhcp binding".  how do you count that with result as the count?

thanks!

4 Replies 4

Rolf Fischer
Level 9
Level 9

Hi,

would "show ip dhcp pool" show what you're looking for?

Pool MYPOOL :

Utilization mark (high/low)    : 100 / 0

Subnet size (first/next)       : 0 / 0

Total addresses                : 254

Leased addresses               : 1

Pending event                  : none

1 subnet is currently in the pool :

Current index        IP address range                    Leased addresses

192.168.1.1          192.168.1.1      - 192.168.1.254     1

Hope that helps

Rolf

actually this is not the only one i want to count, i just want in general like "sh interfaces status"...

anyway i can grab the logs and paste it on excel...

thanks.

try putting "count" before the regual expression, example:

show ip int br | count up

 

This should work in IOS and IOS-XE platforms. I use it to try BGP filters. 

 

itesys_gateway#tclsh
itesys_gateway(tcl)#

itesys_gateway(tcl)#proc count {input} { llength [ split [ exec $input] "\n"]}
itesys_gateway(tcl)#count {show ip dhcp binding}
17

 

ps. watch out for spaces in TCL code!

 

Gianrico Fichera

Review Cisco Networking products for a $25 gift card