How to filter 'show log' to only show STP messages

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
  • (Edited)
- - - - - Challenge from my BOSS - - -

Can any one help me out in this...? If i put " SHOW LOG"- command, I want to see only STP error logs ?? So , What i have to do for that ???
Photo of Boopathy Chandrasekar

Boopathy Chandrasekar

  • 396 Points 250 badge 2x thumb
  • Frustrated

Posted 2 years ago

  • 0
  • 1
Photo of Alexandr P

Alexandr P, Embassador

  • 11,632 Points 10k badge 2x thumb

It is few ways:
1 - some like #show log | include stp
2 - use syntax "match", "events" and "severity" with "show log" command

Thank you!
Thanks Mr.Alexander... But I have tried this earlier.
My requirement is...If i put " SHOW LOG" I want to see only STP logs...!!!
( I think we have to filer the logs in CLI then only its possible..but I doesn't know the commands)
Can you please guide me...!!!!
Photo of Stephen Williams

Stephen Williams, Employee

  • 8,626 Points 5k badge 2x thumb
Not sure why you would want to do that but this is how you would do it.

create log filter stp_logs #creates a new log filter
conf log filter "stp_logs" add events stp  # adds stp logs to the filter
conf log filter "stp_logs" add events stp severity error  # adds only stp error logs to the filter
conf log target memory-buffer filter "stp_logs" #configure memory-buffer for stp logs only
show log configuration #confirm configuration

You will need to clear the logs and then you will only see new STP logs
Stephen thank you so much...!!!!!
I am going to try this one...
Photo of Stephen Williams

Stephen Williams, Employee

  • 8,626 Points 5k badge 2x thumb
No problem.  Let is know if you completed your Boss Challenge.
Stephen , after creating the log filter also I am getting normal logs only and I cannot able to see specific stp messages.
Photo of Henrique

Henrique, Employee

  • 10,282 Points 10k badge 2x thumb
Hi Boopathy,

The procedure described by Stephen should work.

create log filter stp_logs
configure log filter "stp_logs" add events STP 
configure log target memory-buffer filter "stp_logs" 

Please check the output for show log configuration.

That should be similar to:

Log Target      : memory-buffer   
    Enabled     : yes
    Filter Name : stp_logs
    Match regex : Any
    Severity    : Debug-Data (through Critical)
    Format      : MM/DD/YYYY HH:MM:SS.hh <Severity:Component.SubComponent.Condition> 
    Buffer size : 1000 messages

If you want to see STP debug messages, you can use enable log debug-mode. However, this command should be enabled only when advanced diagnostics is required (during troubleshooting only) due to a possible performance degradation.

Thanks a lot Mr.Henrique..!!!
Photo of Stephen Williams

Stephen Williams, Employee

  • 8,626 Points 5k badge 2x thumb
STP doesn't log that much by default.  Check to see if your log counters are going up, and you can add more logs to your filter.  Anything with debug in front will need the command "enable log debug-mode" for it to show in the logs as Henrique mentioned.

# show log counters stp occurred 
Componen SubComponent Condition             Severity    Occurred I Ntfd
-------- ------------ --------------------- ------------- -------- - ----
STP                   DomainEnable          Warning              1 Y 1
STP                   EnterSetPortVPSTState Debug-Verbose     6184 N 0
STP                   FDBFlush              Debug-Summary        1 N 0
STP                   FlushReason           Info              1386 N 0
STP                   NetLoginClntUnAuth    Info              1455 N 0
STP                   SendClntTopoChgMsg    Debug-Summary       15 N 0
STP                   Warning               Info                 1 N 0
STP      InBPDU       Dump                  Debug-Data     3018512 N 0
STP      InBPDU       Trace                 Debug-Verbose  9055536 N 0
STP      OutBPDU      Dump                  Debug-Data    15268664 N 0
STP      OutBPDU      Trace                 Debug-Verbose 15268664 N 0