See below:
[edit protocols bgp]
root@vr-device# show
traceoptions {
file bgp-log;
flag packets detail;
}
group test {
type external;
peer-as 2;
local-as 1;
neighbor 172.16.12.110;
}
[edit protocols bgp]
root@vr-device# run monitor start bgp-log
[edit protocols bgp]
root@vr-device#
*** bgp-log ***
Jun 24 10:58:19.384061 bgp_connect_complete: error connecting to 172.16.12.110
(External AS 2): Socket is not connected
Jun 24 10:58:33.408670
Jun 24 10:58:33.408670 BGP RECV 172.16.12.110+54592 -> 172.16.12.128+179
Jun 24 10:58:33.408790 BGP RECV message type 1 (Open) length 59
Jun 24 10:58:33.408792 BGP RECV version 4 as 2 holdtime 90 id 20.0.0.2 parmlen 30
Jun 24 10:58:33.408794 BGP RECV MP capability AFI=1, SAFI=1
Jun 24 10:58:33.408809 BGP RECV Refresh capability, code=128
Jun 24 10:58:33.408811 BGP RECV Refresh capability, code=2
Jun 24 10:58:33.408920 BGP RECV Restart capability, code=64, time=120, flags=
Jun 24 10:58:33.408922 BGP RECV 4 Byte AS-Path capability (65), as_num 2
Jun 24 10:58:33.409054 advertising graceful restart receiving-speaker-only capability to neighbor 172.16.12.110 (External AS 2)
Jun 24 10:58:33.409056 bgp_send: sending 59 bytes to 172.16.12.110 (External AS 2)
Jun 24 10:58:33.409058
Jun 24 10:58:33.409058 BGP SEND 172.16.12.128+179 -> 172.16.12.110+54592
Jun 24 10:58:33.409060 BGP SEND message type 1 (Open) length 59
Jun 24 10:58:33.409062 BGP SEND version 4 as 1 holdtime 90 id 192.168.11.3 parmlen 30
Jun 24 10:58:33.409064 BGP SEND MP capability AFI=1, SAFI=1
Jun 24 10:58:33.409066 BGP SEND Refresh capability, code=128
...
run monitor stop
start shell
, thentail -f <logfile> | grep <interesting-pattern-here>