简体   繁体   中英

textfsm return empty value

I am trying to parse value from bgp neighbor output from Cisco router using textfsm but it seems like the textfsm config file is incorrect because it return empty list. Below are sample of textfsm config.

Value NEIGHBOR (\d+?\.\d+?\.\d+?\.\d+?)
Start
   ^BGP\sneighbor\sis\s{NEIGHBOR}

BGP output sample

BGP neighbor is 21.21.21.21,  remote AS 65501, internal link
BGP version 4, remote router ID 0.0.0.0
BGP state = Idle
Last read 00:00:21, last write 00:00:21, hold time is 180, keepalive interval is 60 seconds

Kindly suggest suitable solution for this. Cheers.

Seems like there is blank space before BGP.

Value NEIGHBOR (\d+.\d+.\d+.\d+)

Start
  ^\s*BGP\s+neighbor\s+is\s+$NEIGHBOR

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM