⚡
FLASH SALE
— 30% OFF Yearly Network Automation Memberships! Use code
SALE30
at checkout. Offer ends August 20th.
➜ Sign up here
Training
Bootcamp
Courses
Tech Sessions
Resources
Blog
Tips
GitHub
YouTube
Newsletter
Playgrounds
Pricing
Sign In
Become Member
TTP Parser
Validate and test the parsing of your TTP templates
Tools
J2 Renderer
TTP Parser
TextFSM Parser
XPath Tester
Members Only
JMESPath Validator
JSON Schema Validator
Data Format Converter
TTP Template
######################################################################################################## CHECK 15 ######################################################################################################## ## INPUT HOST-NAME#sh snmp user User name: SNMPv3ViewTest Engine ID: 800000090300023A7DC10A07 storage-type: nonvolatile active access-list: 10 Authentication Protocol: SHA Privacy Protocol: AES128 Group-name: SNMPv3ViewRO ## TEMPLATE <group name="snmp_v3"> User name: {{ username | default("") | _line_ | strip() }} storage-type: {{ ignore }} active access-list: {{ acl_snmpv3_number | default("") | _line_ | strip() }} Authentication Protocol: {{ authentication_algorithm | default("") | _line_ | strip() }} Privacy Protocol: {{ encryption_algorithm | default("") | _line_ | strip() }} Group-name: {{ group_name | default("") | _line_ }} </group> ## OUTPUT <doc> This template will check if an SNMPv3 user is configured and it will return the SNMPv3 profile attributes if SNMPv3 is configured --> It will return the following keys: - acl_snmpv3_number - authentication_algorithm - encryption_algorithm - group_name - username if SNMPv3 is not configured --> It will return blank strings on each key. Example Outputs: [ { "snmp_v3": { "acl_snmpv3_number": "40", "authentication_algorithm": "SHA", "encryption_algorithm": "AES128", "group_name": "SNMPv3ViewRO", "username": "SNMPv3ViewTest" } } ] [ { "snmp_v3": { "acl_snmpv3_number": "40", "authentication_algorithm": "", "encryption_algorithm": "AES128", "group_name": "SNMPv3ViewRO", "username": "" } } ] [ { "snmp_v3": { "acl_snmpv3_number": "", "authentication_algorithm": "", "encryption_algorithm": "", "group_name": "", "username": "" } } ] </doc> ######################################################################################################## CHECK 14 ######################################################################################################## ## INPUT GBKNR-FB0-ACCSC-11#show running-config all | include ip source-route no ip source-route ## TEMPLATE <group name="source_route"> {{ output | re("no ip source-route") | default("") }} </group> ## OUTPUT <doc> This template will check if "ip source-route" is enabled or disabled. if enabled --> It will return an "output" key containing an empty list if disabled --> It will return the full command "no ip source-route" Example Outputs: [ { "source_route": { "output": "" } } ] [ { "source_route": { "output": "no ip source-route" } } ] </doc> ######################################################################################################## CHECK 13 ######################################################################################################## ## INPUT GBKNR-FB0-ACCSC-11#show running-config all | include service pad no service pad to-xot no service pad from-xot no service pad cmns no service pad ## TEMPLATE <group name="service_pad"> {{output | re("no service pad") | default("")}} </group> ## OUTPUT <doc> This Template will check if "no service pad" is configured. PAD Referes to X.25 Packet Assembler/Disassembler (PAD) if configured --> It will return the string "no service pad" if not configured --> It will return an "output" key containing an empty list Example Outpus: [ { "service_pad": { "output": "no service pad" } } ] [ { "service_pad": { "output": "" } } ] </doc> ######################################################################################################## CHECK 12 ######################################################################################################## ## INPUT GBKNR-FB0-ACCSC-11#show running-config all | include login block-for login block-for 1800 attempts 10 within 30 ## TEMPLATE <group name="account_lockout"> {{output | re("login block-for \d.* attempts \d.* within \d.*") | default("")}} </group> ## OUTPUT <doc> This template will check if an "Account Lockout" setting is configured. if configured --> It will return the string "login block-for X attempts X within X" if not configured --> It will return an "output" key containing an empty list Example Outputs: [ { "account_lockout": { "output": "login block-for 1800 attempts 10 within 30" } } ] [ { "account_lockout": { "output": "" } } ] </doc> ################################################################################## CHECK 11 ################################################################################## ## INPUT GBKNR-FB0-ACCSC-11#show running-config all | include bootp no ip bootp server ip dhcp bootp ignore no ip dhcp snooping wireless bootp-broadcast enable ip forward-protocol udp bootpc ip forward-protocol udp bootps 10 permit udp host 0.0.0.0 eq bootpc host 255.255.255.255 eq bootps 20 permit udp 1.1.1.1 0.0.0.31 eq bootpc host 255.255.255.255 eq bootps 30 permit udp 1.1.1.1 0.0.0.31 eq bootpc host 1.1.1.2 eq bootps 40 permit udp 1.1.1.1 0.0.0.31 eq bootpc host 1.1.1.3 eq bootps 50 permit udp 1.1.1.1 0.0.0.31 eq bootpc host 1.1.1.4 eq bootps 60 permit udp 1.1.1.1 0.0.0.31 eq bootpc host 1.1.1.5 eq bootps 70 permit udp host 1.1.1.2 eq bootps 1.1.1.1 0.0.0.31 eq bootps 80 permit udp host 1.1.1.3 eq bootps 1.1.1.1 0.0.0.31 eq bootps 90 permit udp host 1.1.1.4 eq bootps 1.1.1.1 0.0.0.31 eq bootps 100 permit udp host 1.1.1.5 eq bootps 1.1.1.1 0.0.0.31 eq bootps 360 permit udp 1.1.1.1 0.0.0.31 eq bootpc host 1.1.1.6 eq bootps 370 permit udp 1.1.1.1 0.0.0.31 eq bootpc host 1.1.1.7 eq bootps 380 permit udp host 1.1.1.6 eq bootps 1.1.1.1 0.0.0.31 eq bootps 390 permit udp host 1.1.1.7 eq bootps 1.1.1.1 0.0.0.31 eq bootps ## TEMPLATE <group name="bootp" itemize="command"> {{ command | re("ip dhcp bootp ignore") | default([]) }} </group> <group name="bootp" itemize="command"> {{ command | re("no ip bootp server") | default([]) }} </group> ## OUTPUT <doc> This template will check if bootp is configured if (ip dhcp bootp ignore) OR (no ip bootp server) exists in the output --> It will return a list with the commands if none of the commands above are configured --> It will return a "bootp" key containing an empty list Example Output: 1 - When both commands are configured: - "ip dhcp bootp ignore" - "no ip bootp server" [ { "bootp": [ "ip dhcp bootp ignore", "no ip bootp server" ] } ] 2 - When one of the commands is configured: - "ip dhcp bootp ignore" [ { "bootp": [ "ip dhcp bootp ignore", ] } ] 3 - When none of the commands are configured: [ { "bootp": [] } ] </doc> ################################################################################## CHECK 10 ################################################################################## ## INPUT GBKNR-FB0-ACCSC-11#show running-config | section aaa authorization aaa authorization console aaa authorization config-commands aaa authorization exec default if-authenticated aaa authorization commands 1 default if-authenticated aaa authorization commands 15 default group NETMAN-TACACS local ## TEMPLATE <group name="aaa.authorization" itemize="output"> {{ output | re("aaa authorization config-commands") | default([]) }} </group> <group name="aaa.authorization" itemize="output"> {{ output | re("aaa authorization exec default group \S+ none") | default([]) }} </group> <group name="aaa.authorization" itemize="output"> {{ output | re("aaa authorization commands 1 default group \S+ none") | default([]) }} </group> <group name="aaa.authorization" itemize="output"> {{ output | re("aaa authorization commands 15 default group \S+ local") | default([]) }} </group> <group name="aaa.authorization" itemize="output"> {{ output | re("aaa authorization console") | default([]) }} </group> ## OUTPUT <doc> This template will check if any of the following commands are configured aaa authorization config-commands aaa authorization exec default group NAMED_SERVER_GROUP none aaa authorization commands 1 default group NAMED_SERVER_GROUP none aaa authorization commands 15 default group NAMED_SERVER_GROUP local aaa authorization console If any of the commands above are configured --> It will return a list with the commands if none of the commands above are configured --> It will return an "authorization" key containing an empty list Example Output: 1 - When all the commands are configured: [ { "aaa": { "authorization": [ "aaa authorization config-commands", "aaa authorization exec default group NAMED_SERVER_GROUP none", "aaa authorization commands 1 default group NAMED_SERVER_GROUP none", "aaa authorization commands 15 default group NETMAN-TACACS local", "aaa authorization commands 15 default group NAMED_SERVER_GROUP local", "aaa authorization console" ] } } ] 2 - When some of the commands are configured: [ { "aaa": { "authorization": [ "aaa authorization config-commands", "aaa authorization console" ] } } ] 3 - When none of the commands are configured: [ { "aaa": { "authorization": [] } } ] </doc>
0
/ 20000
Raw Text
DMLss
0
/ 20000
Result
[ { "aaa": { "authorization": [] }, "account_lockout": { "output": "" }, "bootp": [], "service_pad": { "output": "" }, "snmp_v3": { "acl_snmpv3_number": "", "authentication_algorithm": "", "encryption_algorithm": "", "group_name": "", "username": "" }, "source_route": { "output": "" } } ]
Parse
Share
Auto-Sync