Create an Account  |  Sign in + Post New Thread
<
Popular Discussions
Recent Discussions

Table Parser with Multiple Possible Headers

 

Dustin Witherite Aug 01, 2017

I need to be able to run one command against multiple devices, parse the output and process the variables, and output the data in a usable fashion.

I've gotten everything working, but I've found that some devices have a slightly different output than the rest, and I can't get a table parser to parse both outputs.

Header that majority of devices return:

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----

 

Header that the subset of devices return:

     vlan   mac address    type   learn    age                 ports
----+----+---------------+-------+-----+----------+-----------------------------

 

Notice the additional fields (learn and age) and the variation in capitalization.

How can I have my command node parse both tables to extract the vlan, mac address, and ports fields?

I found a work around by running the command twice and parcing the output differently, then merging the resulting tables.  However, this seems way over kill.

*Edit: Triyng to removed original QApp Attachment - may not be fully cleansed.

Thank you,

 

Dustin

Comments

Amruta Ghule Aug 07, 2017

Dustin Witherite Aug 04, 2017

Dustin Witherite Aug 01, 2017


Please sign in to post comments