×

Warning message

  • Cisco Support Forums is in Read Only mode while the site is being migrated.
  • Cisco Support Forums is in Read Only mode while the site is being migrated.

Cisco IOS show commands output format/pattern

Unanswered Question
Mar 21st, 2015
User Badges:

Hi, i am currently developing a java application to extract data from log files which captured from Cisco routers and switches. Those log files contains output of show commands like show version, show inventory, show process memory, show process cpu, show environment all, show tech-support, etc. To be able to extract the data, my app must be able to recognize the pattern or format of the output for all the Cisco routers and switches. Is there any references or example output of show commands for all the Cisco switches and router ? 

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Leo Laohoo Sat, 03/21/2015 - 07:25
User Badges:
  • Super Gold, 25000 points or more
  • Hall of Fame,

    The Hall of Fame designation is a lifetime achievement award based on significant overall achievements in the community. 

  • Cisco Designated VIP,

    2017 LAN, Wireless

Hi, i am currently developing a java application to extract data from log files which captured from Cisco routers and switches. 

Why don't you just get the output sent to your TFTP server.  For example, you can use the command "sh run | redirect tftp://<TFTP IP address>/filename.txt".

marcass2218 Sat, 03/21/2015 - 09:01
User Badges:

Thx for reply ! =) . Sorry I have made my question unclear to you. What I mean  is how to read the output in filename.txt. In order to able to analyst the output in filename.txt, what I am trying to do is by recognizing some keyword, for example to get the IOS version from the output of sh ver, I will try to find the line which contains the keyword "Cisco IOS Software" at front. So I need to know the format/pattern of the output in the filename.txt. Is there any references or example output of show commands for all the Cisco switches and router ? 

Leo Laohoo Sat, 03/21/2015 - 20:54
User Badges:
  • Super Gold, 25000 points or more
  • Hall of Fame,

    The Hall of Fame designation is a lifetime achievement award based on significant overall achievements in the community. 

  • Cisco Designated VIP,

    2017 LAN, Wireless

In order to able to analyst the output in filename.txt, what I am trying to do is by recognizing some keyword, for example to get the IOS version from the output of sh ver, I will try to find the line which contains the keyword "Cisco IOS Software" at front. 

Command:  sh version | include Cisco IOS Software

Jon Marshall Sun, 03/22/2015 - 14:55
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

You can use the command references for each IOS and/or device where they give examples of outputs.

These can be found by a simple internet search eg "IOS and/or device command reference".

A lot of them will be the same but as there are variants of IOS and NXOS and different devices, especially relevant to switches, the output may differ.

In addition a lot of devices can use modules and so the output can differ greatly depending on what is and isn't installed.

In effect your application needs a sort of template which matches IOS or variant and model of device and then it imports this so it knows where to look in the output for the required commands.

It can be a trial and error procedure and when I was doing automation a tedious process. I often had to log into every different type of device and record where the fields were and what to look for and then, as I say, record all this in a template file that the script would load on startup.

However that was a while back so you may find standardised templates that have done all the hard work for you.

Or you may not :-)

Jon

Actions

This Discussion