Debian Codegraph @

ntc_templates/templates/cisco_ios_show_ip_bgp.textfsm

raw
1 Value Filldown STATUS ([bdhimrsSx*>])
2 Value Filldown PATH_SELECTION ([bdhimrsSx*> ])
3 Value Filldown ROUTE_SOURCE ([bdhimrsSx*> ])
4 Value Filldown NETWORK (\S{0,18})
5 Value Required NEXT_HOP (\S{0,15})
6 Value Filldown METRIC (\S{0,10})
7 Value LOCAL_PREF (\S{0,6})
8 Value WEIGHT (\S{0,6})
9 Value AS_PATH (.*?)
10 Value ORIGIN ([ie\?])
11
12 Start
13 # Since using mostly position, play it safe and ensure we see header first
14 ^\s+Network\s+Next Hop\s+Metric\s+LocPrf\s+Weight\s+Path -> Bgp_table
15 # Capture time-stamp if vty line has command time-stamping turned on
16 ^Load\s+for\s+
17 ^Time\s+source\s+is
18
19 Bgp_table
20 # Account for show ip bgp vpnv4 vrf command
21 ^Route\s+Distinguisher
22 #
23 #
24 # Match if subnet is 17,18 characters long, creates two lines
25 # Example: *>i 10.104.192.208/29
26 ^\s{0,1}${STATUS}${PATH_SELECTION}${ROUTE_SOURCE}\s{0,2}(?=${NETWORK}).{17,18}$$ -> Next
27 #
28 #
29 # Compliment to previous, status, path_selection, route_source, network is filldown.
30 # Example: 200.200.186.194 0 100 50000 64801 64808 64608 64601 64787 i
31 ^\s{20,25}(?=${NEXT_HOP}).{15}\s(?=\s{0,10}${METRIC}).{10}\s(?=\s{0,6}${LOCAL_PREF}).{6}\s(?=\s{0,6}${WEIGHT}).{6}\s*${AS_PATH}\s*${ORIGIN}$$ -> Record
32 #
33 #
34 # Match first when there is no network, since previous line had it already (compliment and filldown below)
35 # Example: *> 0.0.0.0 0 32768 i
36 ^\s{0,1}${STATUS}${PATH_SELECTION}${ROUTE_SOURCE}\s{0,2}\s{16}\s(?=${NEXT_HOP}).{15}\s(?=\s{0,10}${METRIC}).{10}\s(?=\s{0,6}${LOCAL_PREF}).{6}\s(?=\s{0,6}${WEIGHT}).{6}\s*${AS_PATH}\s*${ORIGIN}$$ -> Record
37 #
38 #
39 # Full normal example. metric, and as_path might not exist, regex defaults to blank line.
40 # Example: * i172.16.1.0/24 172.16.1.2 0 100 0 i
41 ^\s{0,1}${STATUS}${PATH_SELECTION}${ROUTE_SOURCE}\s{0,2}(?=${NETWORK}).{16}\s(?=${NEXT_HOP}).{15}\s(?=\s{0,10}${METRIC}).{10}\s(?=\s{0,6}${LOCAL_PREF}).{6}\s(?=\s{0,6}${WEIGHT}).{6}\s*${AS_PATH}\s*${ORIGIN}$$ -> Record
42
43
44 EOF