I have a cli output by moxa switch show running-config
. Interface section may or may not have a name string.
interface ethernet 1/3
shutdown
name Unused
speed-duplex Auto
no flowcontrol
media cable-mode auto
no gmrp
switchport access vlan 1
rate-limit port-disable ingress rate none
no ptp
!
interface ethernet 1/8
shutdown
speed-duplex Auto
no flowcontrol
media cable-mode auto
no gmrp
switchport access vlan 1
rate-limit port-disable ingress rate none
no ptp
This my FSM template for parsing
Value port (\d\/\d)
Value state (shutdown|no shutdown)
Value desc (\S+)
Start
^interface ethernet ${port} -> Continue.Record
^.${state}
^.name.${desc}
But this way the output of the interface name is shifted down one line. How can i fix this template?
Output example
port state desc
------ ----------- ----------------
1/1
1/2 no shutdown Cisco_2960_OTPSS
1/3 no shutdown Mirror
1/8 shutdown Unused
1/9 shutdown
no shutdown Proverka
The link TextFSM usage shows an example fairly similar to your problem when describing incomplete route entries:
In your context: