cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
8575
Views
12
Helpful
4
Replies
Highlighted
Beginner

count line output on ios cli

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
Highlighted
Engager

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

Highlighted

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.

Highlighted

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

show ip int br | count up

Highlighted

 

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

Content for Community-Ad