Creating Textfsm Template For Cisco XR // show isis database

0

I'am trying to create template for show isis database output in Cisco XR, I can't understand what is wrong. Can someone point out? I can not even load template with command of textfsm.TextFSM(template).

Template:

Value LSPID ((\d+.\d+.\d+)|\S+)
Value LSP_SEQ_NUM (0x.+)
Value LSP_CHECKSUM (0x.+)
Value LSP_HOLDTIME (\d+)
Value ATT_P_OL (\d?\/\d?\/\d?)


Start


^${LSPID}\s+${LSP_SEQ_NUM}\s+${LSP_CHECKSUM}\s+${LSP_HOLD_TIME}\s+${ATT_P_OL} -> Record

Output Sample:

RP/0/RSP0/CPU0:PE90URF01#sh isis database
Thu Aug 16 13:20:23.909 Turkiye

IS-IS CORE (Level-2) Link State Database
LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime  ATT/P/OL
PE90ANT03.00-00       0x00001707   0xc0b7        29249           0/0/0
PP90ADN02.00-00       0x0000c36c   0xb576        65476           0/0/0
PE90ADN03_9K.00-00    0x00004f03   0xf19b        65526           0/0/0
PE90ADN04_9K.00-00    0x00004ee5   0xcde8        65465           0/0/0
PP90GZM02.00-00       0x0000dd84   0xe4bf        65452           0/0/0
PE90GZM03_9K.00-00    0x0000364a   0x2120        65431           0/0/0
PE90GZM04_9K.00-00    0x0000339f   0x3369        65496           0/0/0
PP90PSK02.00-00       0x00010e28   0x1779        65531           0/0/0
python-textfsm
asked on Stack Overflow Aug 16, 2018 by Peder Zickler • edited Aug 16, 2018 by Peder Zickler

1 Answer

0

Typo in LSP_HOLDTIME and indentation in regex line is missing. This is working one:

Value LSPID ((\d+.\d+.\d+)|\S+)
Value LSP_SEQ_NUM (0x\S+)
Value LSP_CHECKSUM (0x\S+)
Value LSP_HOLDTIME (\d+)
Value ATT_P_OL (\d?\/\d?\/\d?)

Start
  ^${LSPID}\s+${LSP_SEQ_NUM}\s+${LSP_CHECKSUM}\s+${LSP_HOLDTIME}\s+${ATT_P_OL} -> Record
answered on Stack Overflow Aug 27, 2018 by Alexey Belozerov

User contributions licensed under CC BY-SA 3.0