Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

IOS CLI. How to filter case insensitive?

Hello everyone,

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

Mario Pinho

Everyone's tags (3)
3 REPLIES

IOS CLI. How to filter case insensitive?

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

New Member

IOS CLI. How to filter case insensitive?

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

Re: IOS CLI. How to filter case insensitive?

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

2031
Views
5
Helpful
3
Replies
CreatePlease to create content