最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

logging - How to calculate size of traces logged per minute configured with rsyslog log rotation - Stack Overflow

programmeradmin1浏览0评论

I'm working on a script that logs messages using rsyslog, and I want to calculate the total size of log entries (traces) generated per minute. My rsyslog configuration is set up to rotate logs based on size, as follows:

Example rsyslog configuration

. /var/log/termlog.log termLog 1000000 When the termlog.log file reaches 1,000,000 bytes, it rotates and new traces are written to termlog.log0. Consequently, I need to account for log entries in both termlog.log0 and termlog.log1, especially when the rotation occurs.

Objectives: Calculate the total size of traces logged per minute. Ensure that I account for log entries in both termlog.log, termlog.log0, and termlog.log1 when the rotation is near. Questions: How can I measure the size of log entries per minute in this scenario? What’s the best way to efficiently read the contents of termlog.log, termlog.log0, and termlog.log1 to include their sizes in my calculations?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论