About Auto-Collection Log Files
The configuration in a YAML file determines the contents of an auto-collected log file. You can't configure the amount of
memory used for collected log files. You can configure the frequency of when the stored files get purged.
Autocollected log files get saved in the following directory:
switch# dir bootflash:eem_snapshots
44205843 Sep 25 11:08:04 2019 1480625546_SECURITYD_2_FEATURE_ENABLE_DISABLE_eem_snapshot.tar.gz
Usage for bootflash://sup-local
6940545024 bytes used
44829761536 bytes free
51770306560 bytes total
Accessing the Log Files
Locate the logs by using the command keyword "debug
":
switch# dir debug:///
...
26 Oct 22 10:46:31 2019 log-dump
24 Oct 22 10:46:31 2019 log-snapshot-auto
26 Oct 22 10:46:31 2019 log-snapshot-user
The following table describes the log locations and the log types stored.
Location
|
Description
|
log-dump
|
This folder stores Event logs on log rollover.
|
log-snapshot-auto
|
This folder contains the auto-collected logs for syslog events 0, 1, 2.
|
log-snapshot-user
|
This folder stores the collected logs when you run the bloggerd log-snapshot <> command.
|
Use the following example to view the log files generated on log rollover:
switch# dir debug:log-dump/
debug:log-dump/20191022104656_evtlog_archive.tar
debug:log-dump/20191022111241_evtlog_archive.tar
debug:log-dump/20191022111841_evtlog_archive.tar
debug:log-dump/20191022112431_evtlog_archive.tar
debug:log-dump/20191022113042_evtlog_archive.tar
debug:log-dump/20191022113603_evtlog_archive.tar
Parsing the Log tar Files
Use the following example to parse the logs in the tar files:
switch# show system internal event-logs parse debug:log-dump/20191022104656_evtlog_archive.tar
--------LOGS:/tmp/BLOGGERD0.991453012199/tmp/1-191022104658-191022110741-device_test-M27-V1-I1:0-P884.gz--------
2019 Oct 22 11:07:41.597864 E_DEBUG Oct 22 11:07:41 2019(diag_test_start):Data Space Limits(bytes): Soft: -1 Ha rd: -1
2019 Oct 22 11:07:41.597857 E_DEBUG Oct 22 11:07:41 2019(diag_test_start):Stack Space Limits(bytes): Soft: 500000 Hard: 500000
2019 Oct 22 11:07:41.597850 E_DEBUG Oct 22 11:07:41 2019(diag_test_start):AS: 1005952076 -1
2019 Oct 22 11:07:41.597406 E_DEBUG Oct 22 11:07:41 2019(device_test_process_events):Sdwrap msg unknown
2019 Oct 22 11:07:41.597398 E_DEBUG Oct 22 11:07:41 2019(diag_test_start):Going back to select
2019 Oct 22 11:07:41.597395 E_DEBUG Oct 22 11:07:41 2019(nvram_test):TestNvram examine 27 blocks
2019 Oct 22 11:07:41.597371 E_DEBUG Oct 22 11:07:41 2019(diag_test_start):Parent: Thread created test index:4 thread_id:-707265728
2019 Oct 22 11:07:41.597333 E_DEBUG Oct 22 11:07:41 2019(diag_test_start):Node inserted
2019 Oct 22 11:07:41.597328 E_DEBUG Oct 22 11:07:41 2019(diag_test_start):The test index in diag is 4
2019 Oct 22 11:07:41.597322 E_DEBUG Oct 22 11:07:41 2019(diag_test_start):result severity level
2019 Oct 22 11:07:41.597316 E_DEBUG Oct 22 11:07:41 2019(diag_test_start):callhome alert level
The following table describes the additional keywords available for parsing the specific tar file:
Keyword
|
Description
|
component
|
Decode logs belonging to the component identified by process name.
|
from-datetime
|
Decode logs from a specific date and time in yy[mm[dd[HH[MM[SS]]]]] format.
|
instance
|
List of SDWRAP buffer instances to be decoded (comma separated).
|
module
|
Decode logs from modules such as SUP and LC (using module IDs).
|
to-datetime
|
Decode logs up to a specific date and time in yy[mm[dd[HH[MM[SS]]]]] format.
|
Copying Logs to a Different Location
Use the following example to copy logs to a different location such as a remote server:
switch# copy debug:log-dump/20191022104656_evtlog_archive.tar scp://<ip-adress>/nobackup/<user> vrf management use-kstack
Enter username: user@<ip-address>'s password:
20191022104656_evtlog_archive.tar 100% 130KB 130.0KB/s 00:00
Copy complete, now saving to disk (please wait)...
Copy complete.
Purging Auto-Collection Log Files
There are two types of generated trigger-based auto-collection logs: EventHistory and EventBundle.
Purge Logic for EventHistory Logs
For event history, purging occurs in the /var/sysmgr/srv_logs/xport folder. 250MB of partitioned RAM is mounted at /var/sysmgr/srv_logs
directory.
If the /var/sysmgr/srv_logs memory usage is under 65% of the 250MB allocated, no files get purged. When the memory utilization
reaches the 65% limit level, the oldest files get purged until there's enough memory available to continue saving new logs.
Purge Logic for EventBundle Logs
For event bundles, the purge logic occurs in the /bootflash/eem_snapshots folder. For storing the auto-collected snapshots,
the EEM auto-collect script allocates 5% of the bootflash storage. The logs get purged once the 5% bootflash capacity is used.
When a new auto-collected log is available but there's no space to save it in bootflash (already at 5% capacity), the system
checks the following:
-
If there are existing auto-collected files that are more than 12 hours old, the system deletes the files and the new logs
get copied.
-
If the existing auto collected files are less than 12 hours old, the system discards the newly collected logs without saving
them.
You can modify the 12-hour default purge time by using the following commands. The time specified in the command is in minutes.
switch(config)# event manager applet test override __syslog_trigger_default
switch(config-applet)# action 1.0 collect test.yaml purge-time 300 $_syslog_msg
event manager command: test is an example name for the policy. __syslog_trigger_default is the name of the system policy that you want to override. This name must begin with a double underscore ( __ ).
action command: 1.0 is an example number for the order in which the action is executed. collect indicates that data is collected using the YAML file. test.yaml is an example name of the YAML file. $_syslog_msg is the name of the component.
Note
|
At any given time, there can be only one trigger-based auto-collection event in progress. If another new log event is attempting
to be stored when auto-collection is already occurring, the new log event is discarded.
|
By default, there's only one trigger-based bundle collected every five minutes (300 sec). This rate limiting is also configurable
by the following commands. The time specified in the command is in seconds.
switch(config)# event manager applet test override __syslog_trigger_default
switch(config-applet)# action 1.0 collect test.yaml rate-limit 600 $_syslog_msg
event manager command: test is an example name for the policy. __syslog_trigger_default is an example name of the system policy to override. This name must begin with a double underscore ( __ ).
action command: 1.0 is an example number for the order in which the action is executed. collect indicates that data is collected using the YAML file. test.yaml is an example name of the YAML file. $_syslog_msg is the name of the component.
Beginning with Release 10.1(1), the rate of collection can also be regulated using a maximum number of triggers option, ensuring
that only those many number of triggers are honored. After the max-triggers value is reached, no more bundles will be collected on the syslog occurrence.
event manager applet test_1 override __syslog_trigger_default
action 1.0 collect test.yaml rate-limt 30 max-triggers 5 $_syslog_msg
Note
|
If you delete auto collected bundles manually from debug:log-snapshot-auto/ , then it will restart the collection based on the configured number of max-triggers when the next event occurs.
|
Auto-Collection Statistics and History
The following example shows trigger-based collection statistics:
switch# show system internal event-logs auto-collect statistics
---------------------EEM Auto Collection Statistics--------------------
Syslog Parse Successful :88 Syslog Parse Failure :0
Syslog Ratelimited :0 Rate Limit Check Failed :0
Syslog Dropped(Last Action In Prog) :53 Storage Limit Reached :0
User Yaml Action File Unavailable :0 User Yaml Parse Successful :35
User Yaml Parse Error :0 Sys Yaml Action File Unavailable :11
Sys Yaml Parse Successful :3 Sys Yaml Parse Error :0
Yaml Action Not Defined :0 Syslog Processing Initiated :24
Log Collection Failed :0 Tar Creation Error :0
Signal Interrupt :0 Script Exception :0
Syslog Processed Successfully :24 Logfiles Purged :0
The following example shows trigger-based collection history (the processed syslogs, process time, size of the data collected)
obtained using a CLI command:
switch# show system internal event-logs auto-collect history
DateTime Snapshot ID Syslog Status/Secs/Logsize(Bytes)
2019-Dec-04 05:30:32 1310232084 VPC-0-TEST_SYSLOG PROCESSED:9:22312929
2019-Dec-04 05:30:22 1310232084 VPC-0-TEST_SYSLOG PROCESSING
2019-Dec-04 04:30:13 1618762270 ACLMGR-0-TEST_SYSLOG PROCESSED:173:33194665
2019-Dec-04 04:28:47 897805674 SYSLOG-1-SYSTEM_MSG DROPPED-LASTACTIONINPROG
2019-Dec-04 04:28:47 947981421 SYSLOG-1-SYSTEM_MSG DROPPED-LASTACTIONINPROG
2019-Dec-04 04:27:19 1618762270 ACLMGR-0-TEST_SYSLOG PROCESSING
2019-Dec-04 02:17:16 1957148102 CARDCLIENT-2-FPGA_BOOT_GOLDEN NOYAMLFILEFOUND