In general - it's safe to delete all the log files, but in the scope of this document, only log files older than one day are deleted.
- Log into the vRealize Log Insight node as root via SSH or Console, pressing ALT+F1 in a Console to log in.
- Run the following command to truncate the logs:
find /storage/var/loginsight
-maxdepth 1 -mount -mtime +1 -type f -regex ".*[\._]log.+" -exec echo {} \; -exec rm {} \; 2>&1 | tee /tmp/deleted_logs.txt
- Repeat steps 1-2 on all other affected nodes.
Note: To delete logs generated specifically by Apache Tomcat, execute the following command:
find apache-tomcat/logs -maxdepth 1 -mount -mtime +1 -type f -exec echo {} \; -exec rm {} \; 2>&1 | tee /tmp/deleted_tomcat_logs.txt
This command is similar to the command above with a slight deference. Apache Tomcat logs have format LogName.date.log and it's hard determine if it's an already rotated log file or the one currently in use. Thus, we are deleting all the files that has modification date greater than 1 day (the -mtime +1 option).