05-17-2022 07:50 PM
Is there a way to get 24 hour logs on a switch port?. I had been doing something like sh log | i month date. I need a way to checking 24 hours logs every day.
05-17-2022 07:57 PM
Syslog
05-17-2022 07:59 PM
Thank you for your reply. Is there any other way to get the logs through a command in cisco?
05-17-2022 08:09 PM
@hamsini0992 wrote:
Thank you for your reply. Is there any other way to get the logs through a command in cisco?
Default log buffer is only 4096. Increase that value to, say, 409600.
05-17-2022 08:49 PM
Thank you for your reply. Can I try anything like sh log i <interface_name | i May 13 | i May 14. Will this give me logs of two dates?
05-17-2022 09:29 PM
check below post.
https://superuser.com/questions/995051/cisco-show-logging-command-filtered-by-specific-date
05-17-2022 09:47 PM
@hamsini0992 wrote:
Thank you for your reply. Can I try anything like sh log i <interface_name | i May 13 | i May 14. Will this give me logs of two dates?
How many ports are you trying to "target"?
If there is only one port, I have a very simple idea: Disable interface port logging except for the one target port.
05-17-2022 10:00 PM - edited 05-17-2022 10:02 PM
Thank you for the response. I am trying to look for specific patterns in an interface. I want to track this down status over a period of 24 hours without any syslogs. If I do only May 13, it will fetch me the result only for May 13. But I want to look for pattern for the last 24 hours.
eg., sh log | count May 13.*"***DOWN*** <interface_name>
Is there any way, I could give from and to dates
eg, sh log | count May 13.*"***DOWN*** <interface_name> ..(May 14) - Like between May 13 and May 14
I tried doing something like
sh log | count May 13.*"***DOWN*** <interface_name> | count May 14.*"***DOWN*** <interface_name> . But this gave me 0 matches.
05-17-2022 10:14 PM - edited 05-17-2022 10:14 PM
How many ports?
05-17-2022 10:23 PM
Per switch one interface. There are more than 2000 switches
05-17-2022 10:32 PM
One port only?
Disable link logging to every ports except this one.
05-18-2022 12:14 AM
If you have more than 2000 switches, I suggest having SYSLOG Server and Role over the Syslog every 24 hours for each device, From all devices send interface activity logs to the Syslog server. Write a small script (your own comfort programming, I prefer Python here) . grep all the Logs, (if the interface number matches in the Log, extract the Logs stored in a database or CSV format. you can extract reports based on the data collected in due course of time.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide