Junos OS

last person joined: yesterday 

Ask questions and share experiences about Junos OS.
  • 1.  CLI query

    Posted 07-04-2008 06:11

    Hi,

     

    I want to query some part of the config for 3 values, and then list/save this information.

     

    For instance, we have multiple BGP peer-groups containing multiple BGP peers:

     

    neighbor TEXT STRING 1 {
        description TEXT STRING 2

       <SNIP>

        peer-as TEXT STRING 3;

     

     I would like to match against ONLY strings 1-3 and output this for ALL neighbours within the specified peer-group to a text file.

     

     Something like:

     

     show configuration protocols bgp group peers | match "neighbor" "description" "peer-as" save "peer.txt"

     

    Is this possible from CLI or from a BSD Shell?

     

     

    Many thanks,

     

    Chris

     



  • 2.  RE: CLI query
    Best Answer

    Posted 07-04-2008 13:20

    JUNOS gives you numerous ways to find the text you wish to find...

     

    The below mentioned command will give you the required results. 

     

    juniper# run show configuration  | grep "neighbor|description|peer-as" | save outfile.txt

    Message Edited by masoodnt10 on 07-05-2008 01:21 AM


  • 3.  RE: CLI query

    Posted 07-07-2008 00:03
    Indeed it does. Thank you Masood.