You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Value PORT (\S+)
Value NAME (.+?)
Value STATUS (err-disabled|disabled|connected|notconnect|inactive|up|down|monitoring|suspended)
Value VLAN_ID (\d+|trunk|routed|unassigned)
Value DUPLEX (\S+)
Value SPEED (\S+)
Value TYPE (.*)
Value FC_MODE (\S+)
Start
^Load\s+for\s+
# Capture time-stamp if vty line has command time-stamping turned on
^Time\s+source\s+is
^-+\s*$$
^Port\s+Name\s+Status\s+Vlan\s+Duplex\s+Speed\s+Type -> Interfaces
^\s*$$
^. -> Error
Interfaces
#Match fc...
^\s*${PORT}\s+is\s+${STATUS}\s+Port\s+mode\s+is\s+${FC_MODE}\s*$$ -> Record
^\s*${PORT}\s+is\s+${STATUS}\s+\(${TYPE}\)\s*$$ -> Record
^\s*${PORT}\s+${STATUS}\s+${VLAN_ID}\s+${DUPLEX}\s+${SPEED}\s*${TYPE}$$ -> Record
^\s*${PORT}\s+${NAME}\s+${STATUS}\s+${VLAN_ID}\s+${DUPLEX}\s+${SPEED}\s*${TYPE}$$ -> Record
^\s*${PORT}\s+${NAME}\s+${STATUS}:?\s+${VLAN_ID}\s+${DUPLEX}\s+${SPEED}\s*${TYPE}\s*$$ -> Record
^-+
^\s*$$
^. -> Error
when I use the following regex in place of the line containing :?\s+: (line 24)
^\s*${PORT}\s+${NAME}\s+${STATUS}:.*\s${VLAN_ID}\s+${DUPLEX}\s+${SPEED}\s*${TYPE}\s*$$ -> Record
I get what I would expect:
"GigabitEthernet3/0/16": {
"duplex": "auto",
"shutdown": "false",
"description": "asdfqwerzxcv",
"state": "reserved",
"port_name": "GigabitEthernet3/0/16", "activation_status": "on",
"vlan": "1137", "speed": "auto"
},
ACTUAL RESULTS
"error": "Error processing interface output in TextFSM"
The text was updated successfully, but these errors were encountered:
ISSUE TYPE
TEMPLATE USING
SAMPLE COMMAND OUTPUT
SUMMARY
https://community.cisco.com/t5/switching/cisco-9300-switch-show-interfaces-status-displays-connected-t/td-p/4591464
The colon isn't followed by just whitespace. In the example case, the status including additional text is 'connected: TDR running'.
The additional text gets truncated so the patter match is a colon following status, any char including space for the message, and a space before the VLAN field.
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: