cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
cancel
8722
Views
11
Helpful
5
Replies

IOS CLI. How to filter case insensitive?

mario_kmc
Level 1
Level 1

Hello everyone,

Is there a way to filter IOS output (include/exclude/begin...) case insensitive?

Mario Pinho

5 Replies 5

Rolf Fischer
Level 9
Level 9

Hi Mario,

not really.

You can use patterns like [Vv]lan, (VLAN|vlan) or [Vv][Ll][Aa][Nn] but that's not handy at all, is it?

Are you looking for something special?

Best regards

Rolf

Hi Fischer,

Thank you. I have considered these and they come in handy in some command outputs where first letter can be capitalized.

I'm not looking for something in particular but full case insensitive searching for user inserted commands like ACL names, descriptions, route-maps, etc. While we do try to maintin rules (all small caps for example) sometimes they are not respected. With case insensitive search I can just put the word and see results instead of having to think of combinations or having to copy text to notepad++ and do a search there.

SecureCRT also helps with its search feature but that gets out of hand in a long session

Hi Mario,

I see. I don't know any freeware software for such configuration compliance tasks.

If you want to have some kind of automation you could

  1. Download your running-configs to a TFTP server and use grep or a more advanced script to extract the lines your're looking for (the TFTP download could also be done by that scipt =>SNMP)
  2. Use TCL if your devices support it

A simple example:

R1#show int loop0 description

Interface                      Status         Protocol Description

Lo0                            up             up       TEST

R1#tclsh

R1(tcl)#puts [regexp {test} [exec "show int loop0 descr"]]

0

R1(tcl)#puts [regexp -nocase {test} [exec "show int loop0 descr"]]

1

R1(tcl)#tclquit

There's a section for EEM scripting, so if you want to create a custom command for your needs, you'll get help there.

Best regards

Rolf

wireman84
Level 1
Level 1

MY VOTE

Does not exist, but really should!  Cisco should add to IOS!  Something like "show run | inc -i cellular" for example.

mcardinal
Level 1
Level 1

A -i option like grep uses would definitely be preferred, but for the case I was searching this topic for...

show running-config | include [Vv][Ll][Aa][Nn]

works just fine  Thank you Rolf Fischer!

Review Cisco Networking for a $25 gift card