Ethernet Switching
Reply
Visitor
a.schwarzer@brillux.de
Posts: 9
Registered: ‎04-15-2012
0
Accepted Solution

CLI Command to search and show configuration

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. 

 

 

Distinguished Expert
spuluka
Posts: 2,691
Registered: ‎03-30-2009
0

Re: CLI Command to search and show configuration

[ Edited ]

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 Network Engineer - UPMC Pittsburgh, PA
JNCIA-ER JNCIA-EX JNCIS-SEC JNCIP-SEC
JNCIS-FWV JNCIS-SSL
MCP - Managing Server 2003 MCP - Windows XP Professional
MCTS Windows 7
http://puluka.com/home
Visitor
a.schwarzer@brillux.de
Posts: 9
Registered: ‎04-15-2012
0

Re: CLI Command to search and show configuration

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.

Distinguished Expert
spuluka
Posts: 2,691
Registered: ‎03-30-2009
0

Re: CLI Command to search and show configuration

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 Network Engineer - UPMC Pittsburgh, PA
JNCIA-ER JNCIA-EX JNCIS-SEC JNCIP-SEC
JNCIS-FWV JNCIS-SSL
MCP - Managing Server 2003 MCP - Windows XP Professional
MCTS Windows 7
http://puluka.com/home
Visitor
a.schwarzer@brillux.de
Posts: 9
Registered: ‎04-15-2012
0

Re: CLI Command to search and show configuration

HI Steve,

 

that is a great tip,it works and solve my problem, cool :smileyhappy:

 

Thanks for the help and a nice day!

Super Contributor
AdamLin
Posts: 167
Registered: ‎08-02-2010
0

Re: CLI Command to search and show configuration

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)
Copyright© 1999-2013 Juniper Networks, Inc. All rights reserved.