Skip to content

Commit

Permalink
IOS SHOW MAC-ADDRESS TABLE: Add new layout of cli output (#342)
Browse files Browse the repository at this point in the history
* Fix standard regular expressions to skip headers

* Add test files for template update
  • Loading branch information
jmcgill298 authored Jan 21, 2019
1 parent a377186 commit bb08349
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 2 deletions.
3 changes: 1 addition & 2 deletions templates/cisco_ios_show_mac-address-table.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Value DESTINATION_ADDRESS (\w+.\w+.\w+)
Value DESTINATION_ADDRESS ([0-9a-fA-F]{4}\.[0-9a-fA-F]{4}\.[0-9a-fA-F]{4})
Value TYPE (\w+)
Value VLAN (\w+)
Value DESTINATION_PORT (\S+)
Expand All @@ -20,4 +20,3 @@ TYPE3

TYPE4
^\s+${VLAN}\s+${DESTINATION_ADDRESS}\s+${TYPE}\s+${DESTINATION_PORT} -> Record

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
parsed_sample:
- destination_address: "009e.1ead.eadd"
type: "dynamic"
vlan: "420"
destination_port: "Po140"

- destination_address: "009e.1ead.eadd"
type: "dynamic"
vlan: "420"
destination_port: "Po140"

- destination_address: "009e.1ead.eadd"
type: "dynamic"
vlan: "420"
destination_port: "Po140"

- destination_address: "009e.1ead.eadd"
type: "dynamic"
vlan: "420"
destination_port: "Po140"

- destination_address: "009e.1ead.eadd"
type: "dynamic"
vlan: "420"
destination_port: "Po140"

- destination_address: "009e.1ead.eadd"
type: "dynamic"
vlan: "420"
destination_port: "Po140"

- destination_address: "009e.1ead.eadd"
type: "dynamic"
vlan: "420"
destination_port: "Po140"

- destination_address: "009e.1ead.eadd"
type: "dynamic"
vlan: "420"
destination_port: "Po140"

- destination_address: "009e.1ead.eadd"
type: "dynamic"
vlan: "420"
destination_port: "Po140"

- destination_address: "009e.1ead.eadd"
type: "dynamic"
vlan: "420"
destination_port: "Po140"

Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
Legend: * - primary entry
age - seconds since last seen
n/a - not available
S - secure entry
R - router's gateway mac address entry
D - Duplicate mac address entry

Displaying entries from DFC switch [1] linecard [1]:

vlan mac address type learn age ports
----+----+---------------+-------+-----+----------+-----------------------------
420 009e.1ead.eadd dynamic Yes 160 Po140


Displaying entries from DFC switch [1] linecard [2]:

vlan mac address type learn age ports
----+----+---------------+-------+-----+----------+-----------------------------
* 420 009e.1ead.eadd dynamic Yes 5 Po140


Displaying entries from DFC switch [1] linecard [3]:

vlan mac address type learn age ports
----+----+---------------+-------+-----+----------+-----------------------------
420 009e.1ead.eadd dynamic Yes 45 Po140


Displaying entries from DFC switch [1] linecard [4]:

vlan mac address type learn age ports
----+----+---------------+-------+-----+----------+-----------------------------
420 009e.1ead.eadd dynamic Yes 175 Po140


Displaying entries from active supervisor:

vlan mac address type learn age ports
----+----+---------------+-------+-----+----------+-----------------------------
420 009e.1ead.eadd dynamic Yes 65 Po140


Displaying entries from DFC switch [2] linecard [1]:

vlan mac address type learn age ports
----+----+---------------+-------+-----+----------+-----------------------------
420 009e.1ead.eadd dynamic Yes 140 Po140


Displaying entries from DFC switch [2] linecard [2]:

vlan mac address type learn age ports
----+----+---------------+-------+-----+----------+-----------------------------
* 420 009e.1ead.eadd dynamic Yes 5 Po140


Displaying entries from DFC switch [2] linecard [3]:

vlan mac address type learn age ports
----+----+---------------+-------+-----+----------+-----------------------------
420 009e.1ead.eadd dynamic Yes 120 Po140


Displaying entries from DFC switch [2] linecard [4]:

vlan mac address type learn age ports
----+----+---------------+-------+-----+----------+-----------------------------
420 009e.1ead.eadd dynamic Yes 180 Po140


Displaying entries from standby supervisor:

vlan mac address type learn age ports
----+----+---------------+-------+-----+----------+-----------------------------
420 009e.1ead.eadd dynamic Yes 115 Po140

0 comments on commit bb08349

Please sign in to comment.