Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Issue with cisco_ios_show_vrf.textfsm template #786

Closed
rara08 opened this issue Jul 31, 2020 · 2 comments
Closed

Issue with cisco_ios_show_vrf.textfsm template #786

rara08 opened this issue Jul 31, 2020 · 2 comments

Comments

@rara08
Copy link

rara08 commented Jul 31, 2020

@whitej6

ISSUE TYPE
  • Bug Report
TEMPLATE USING

`
Value Required NAME (\S+)
Value DEFAULT_RD ((\d+|\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}):\d+|)
Value PROTOCOLS (\S+)
Value List INTERFACES (\S+)

Start
^\s+Name\s+Default RD\s+Protocols\s+Interfaces -> Start_record
# Capture time-stamp if vty line has command time-stamping turned on
^Load\s+for\s+
^Time\s+source\s+is

Start_record
^\s{2}\S+ -> Continue.Record
^\s{60}\s+${INTERFACES}
^\s+${NAME}\s+${DEFAULT_RD}\s+${PROTOCOLS}\s+${INTERFACES}
`

SAMPLE COMMAND OUTPUT from stdout

Name Default RD Protocols Interfaces\n Mgmt-vrf ipv4,ipv6 Gi0/0\n user 172.30.197.254:5 ipv4 Lo0\n Vl10\n Vl11\n Vl25

SUMMARY

Parser does not parse output correctly. I had to remove "\s+" from start (line 7).
This was on Cat9K running - Cisco IOS XE Software, Version 16.06.06

STEPS TO REPRODUCE

'

  • name: SYS >> Parse show vrf command
    set_fact:
    vrf_facts: "{{ command_output.stdout[0] | parse_cli_textfsm('template/cisco_ios_show_vrf.template') }}"
    '
EXPECTED RESULTS

Correctly structure "sh vrf" output.

ACTUAL RESULTS

Failed parse, empty variable.
vrf_facts = []

@zkiroel
Copy link

zkiroel commented Aug 25, 2020

hello, are you able to share an image that illustrates how that must work (output sample I mean), please?
my device is c76xx and removing \s+ was not helped with 'show vrf'
Thank you

@itdependsnetworks
Copy link
Contributor

Closing pending receipt of raw data, feel free to re-open/re-create once that raw data is provided.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants