[c-nsp] display last lines of logging

Ed Ravin eravin at panix.com
Thu May 24 11:02:37 EDT 2007


> On Thu, May 24, 2007 at 05:26:01PM +0300, Tassos Chatzithomaoglou wrote:
> > I was wondering....
> > 
> > Is there a way to display the x last lines of the log of a router (through the cli) ?
> > Like the CatOS "sh logging buffer -x" is doing.

Or like the Unix "tail" command?  Apparently not.  But here's a really,
really, really ugly way to simulate it:

In your config, put:

  service sequence-numbers

And then, if you know the sequence numbers of the last few messages,
you can ask to see the last few messages via regexp:

  Router#show logging | inc (0700|0699):
  000699: .May 24 10:54:19: %SYS-5-CONFIG_I: Configured from console by admin on vty0 (10.10.10.10)
  000700: .May 24 10:54:26: %SYS-5-CONFIG_I: Configured from console by admin on vty0 (10.10.10.10)

You should have the router logging to a syslog server on your network, that
way you will not only be able to look at logs that would be lost when the
router reloads, you can use the host's file viewing commands to see the
portions of the log you're interested in or run other post-processing on
the log.


More information about the cisco-nsp mailing list