i want to use the template below to parse a multiline commands, but i find Value like "protocol" and "vpn_instance" be filledup by default, how can i avoid it and retrieve the correct empty value? It feels strange, but i have no idea, I would appreciate some advice.
Value Filldown acl_name ((\S+|\d+))
Value Filldown description (\S+(\s+\S+)*)
Value Required rule_num (\d+)
Value Required action (permit|deny)
Value protocol (ip|tcp|udp)
Value vpn_instance (\S+)
Value source_ip ((\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|any)
Value source_wildcard ((\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|0)
Value source_port ((eq|ge|le) (\S+|\d+))
Value dest_ip ((\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|any)
Value dest_wildcard ((\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|0)
Value dest_port ((eq|ge|le) (\S+|\d+))
Value dscp (\d+)
Value counting (counting)
Value List NotParsed (.*)
Start
^acl number ${acl_name}
^\s+description ${description}
^\s+rule ${rule_num} ${action}( ${protocol})*( vpn-instance ${vpn_instance})*( source ${source_ip}( ${source_wildcard})*)*( destination-port ${dest_port})*( ${counting})* -> Record
^\s+${NotParsed}
^# -> Record
[
{
"acl_name": "2000",
"action": "permit",
"counting": "counting",
"description": "for-nms-vty",
"dest_ip": "",
"dest_port": "eq bootpc",
"dest_wildcard": "",
"dscp": "",
"protocol": "udp",
"rule_num": "5",
"source_ip": "172.16.0.0",
"source_port": "",
"source_wildcard": "0.15.255.255",
"vpn_instance": "IBMGT"
},
{
"acl_name": "2000",
"action": "permit",
"counting": "counting",
"description": "for-nms-vty",
"dest_ip": "",
"dest_port": "eq bootpc",
"dest_wildcard": "",
"dscp": "",
"protocol": "udp",
"rule_num": "10",
"source_ip": "192.168.0.0",
"source_port": "",
"source_wildcard": "0.0.255.255",
"vpn_instance": "IBMGT"
},
{
"acl_name": "2000",
"action": "permit",
"counting": "counting",
"description": "for-nms-vty",
"dest_ip": "",
"dest_port": "eq bootpc",
"dest_wildcard": "",
"dscp": "",
"protocol": "udp",
"rule_num": "15",
"source_ip": "10.0.0.0",
"source_port": "",
"source_wildcard": "0.255.255.255",
"vpn_instance": "IBMGT"
},
{
"acl_name": "2000",
"action": "permit",
"counting": "counting",
"description": "for-nms-vty",
"dest_ip": "",
"dest_port": "eq bootpc",
"dest_wildcard": "",
"dscp": "",
"protocol": "udp",
"rule_num": "20",
"source_ip": "172.16.0.0",
"source_port": "",
"source_wildcard": "0.15.255.255",
"vpn_instance": "IBMGT"
},
{
"acl_name": "2000",
"action": "permit",
"counting": "counting",
"description": "for-nms-vty",
"dest_ip": "",
"dest_port": "eq bootpc",
"dest_wildcard": "",
"dscp": "",
"protocol": "udp",
"rule_num": "25",
"source_ip": "192.168.0.0",
"source_port": "",
"source_wildcard": "0.0.255.255",
"vpn_instance": "IBMGT"
},
{
"acl_name": "2000",
"action": "permit",
"counting": "counting",
"description": "for-nms-vty",
"dest_ip": "",
"dest_port": "eq bootpc",
"dest_wildcard": "",
"dscp": "",
"protocol": "udp",
"rule_num": "30",
"source_ip": "10.0.0.0",
"source_port": "",
"source_wildcard": "0.255.255.255",
"vpn_instance": "IBMGT"
},
{
"acl_name": "2000",
"action": "permit",
"counting": "counting",
"description": "for-nms-vty",
"dest_ip": "",
"dest_port": "eq bootpc",
"dest_wildcard": "",
"dscp": "",
"protocol": "udp",
"rule_num": "35",
"source_ip": "106.75.220.0",
"source_port": "",
"source_wildcard": "0.0.0.127",
"vpn_instance": "IBMGT"
},
{
"acl_name": "2000",
"action": "permit",
"counting": "counting",
"description": "for-nms-vty",
"dest_ip": "",
"dest_port": "eq bootpc",
"dest_wildcard": "",
"dscp": "",
"protocol": "udp",
"rule_num": "40",
"source_ip": "100.96.0.0",
"source_port": "",
"source_wildcard": "0.31.255.255",
"vpn_instance": "IBMGT"
},
{
"acl_name": "2000",
"action": "permit",
"counting": "counting",
"description": "for-nms-vty",
"dest_ip": "",
"dest_port": "eq bootpc",
"dest_wildcard": "",
"dscp": "",
"protocol": "udp",
"rule_num": "45",
"source_ip": "100.96.0.0",
"source_port": "",
"source_wildcard": "0.31.255.255",
"vpn_instance": "IBMGT"
},
{
"acl_name": "2000",
"action": "deny",
"counting": "counting",
"description": "for-nms-vty",
"dest_ip": "",
"dest_port": "eq bootpc",
"dest_wildcard": "",
"dscp": "",
"protocol": "udp",
"rule_num": "1000",
"source_ip": "10.81.40.4",
"source_port": "",
"source_wildcard": "0",
"vpn_instance": ""
},
{
"acl_name": "3333",
"action": "permit",
"counting": "counting",
"description": "dhcp request",
"dest_ip": "",
"dest_port": "eq bootpc",
"dest_wildcard": "",
"dscp": "",
"protocol": "udp",
"rule_num": "5",
"source_ip": "10.81.40.4",
"source_port": "",
"source_wildcard": "0",
"vpn_instance": ""
},
{
"acl_name": "3333",
"action": "permit",
"counting": "counting",
"description": "dhcp request",
"dest_ip": "",
"dest_port": "eq bootpc",
"dest_wildcard": "",
"dscp": "",
"protocol": "udp",
"rule_num": "10",
"source_ip": "10.81.40.4",
"source_port": "",
"source_wildcard": "0",
"vpn_instance": ""
},
{
"acl_name": "3334",
"action": "permit",
"counting": "counting",
"description": "dhcp reply",
"dest_ip": "",
"dest_port": "eq bootps",
"dest_wildcard": "",
"dscp": "",
"protocol": "udp",
"rule_num": "5",
"source_ip": "10.81.40.4",
"source_port": "",
"source_wildcard": "0",
"vpn_instance": ""
}
]
i want to use the template below to parse a multiline commands, but i find Value like "protocol" and "vpn_instance" be filledup by default, how can i avoid it and retrieve the correct empty value? It feels strange, but i have no idea, I would appreciate some advice.
template is below,
raw command output is here,
the result returned ,