Ethernet Switching
Highlighted
Ethernet Switching

CLI Command to search and show configuration

06.26.12   |  
‎06-26-2012 11:33 PM

Hello,

 

i search a CLI Command for EX-Switche, with that i can search for one a description und get the hole config auf the interface. 

 

When i use " | grep " and so on i get only the single line where the search word will be find.

 

 

Thanks for help

 

Andre S. 

 

 

5 REPLIES
Ethernet Switching

Re: CLI Command to search and show configuration

[ Edited ]
06.27.12   |  
‎06-27-2012 03:56 AM

For finding lines in the configuration you can use the match keyword from the operations mode.

 

ex>show configuration | match string

 

This will return all lines with the "string" on them.

Steve Puluka BSEET
Juniper Ambassador
Senior IP Engineer - DQE Communications Pittsburgh, PA (Metro Ethernet & ISP)
JNCIA-Junos JNCIS-SEC JNCIP-SEC JNCSP-SEC
JNCIS-FWV
JNCDA JNCDS-DC JNCDS-SEC
JNCIS-SP
ACE PanOS 6 ACE PanOS 7
http://puluka.com/home
Ethernet Switching

Re: CLI Command to search and show configuration

06.27.12   |  
‎06-27-2012 04:32 AM

Hi Steve,

 

thanks for your answer, but i search a command where i can see the complete configuration from the interface, where the word/text will be find that i search for.

Ethernet Switching

Re: CLI Command to search and show configuration

06.27.12   |  
‎06-27-2012 02:48 PM

Sorry, I didn't get what you were after.  I don't think you can see this with just a match on the description.

 

I'm thinking your best bet would be a two step process.  Use this first match to get the interface number.

 

ex> show configuration | display set | match description

 Then use this second match to see all the confirguration associated with the interface number

 

ex>show configuration | display set | match 0/0/2

 The display set function pulls the configuration as single lines with the set commands rather than in the spread out hierarchical display.  This will put hte interface number on all the paramter lines so you can see all the interface settings.

Steve Puluka BSEET
Juniper Ambassador
Senior IP Engineer - DQE Communications Pittsburgh, PA (Metro Ethernet & ISP)
JNCIA-Junos JNCIS-SEC JNCIP-SEC JNCSP-SEC
JNCIS-FWV
JNCDA JNCDS-DC JNCDS-SEC
JNCIS-SP
ACE PanOS 6 ACE PanOS 7
http://puluka.com/home
Ethernet Switching

Re: CLI Command to search and show configuration

06.28.12   |  
‎06-28-2012 11:46 PM

HI Steve,

 

that is a great tip,it works and solve my problem, cool Smiley Happy

 

Thanks for the help and a nice day!

Ethernet Switching

Re: CLI Command to search and show configuration

07.16.12   |  
‎07-16-2012 06:17 AM
Also,
If you're using descriptions, you might aswell use "show interfaces description".

user@switch> show interfaces descriptions
Interface Admin Link Description
xe-0/1/2 up up to CORE switch

user@switch> show configuration interfaces xe-0/1/2
description "to CORE switch";
ether-options {
802.3ad ae0;
}
Regards,
Adam

(if my post helped solve your problem, mark it as accepted solution)