zoukankan      html  css  js  c++  java
  • freshStartTail 第一次启动时 抛弃旧的日志

    freshStartTail [on/off] (requires v8.18.0+)
    Default: off
    
    This is used to tell rsyslog to seek to the end/tail of input files (discard old logs)**at its first start(freshStart)** and process only new log messages.
    
    When deploy rsyslog to a large number of servers, we may only care about new log messages generated after the deployment. set freshstartTail to on will discard old logs. Otherwise, there may be vast useless message burst on the remote central log receiver
    
    
    这是告诉 rsyslog来寻求 输入日志的尾部,抛弃旧的日志 在第一次启动的时候,只处理最新的日志
    
    当部署rsyslog 到一大量的服务器的时候,我们只关心新的日志,
    
    设置 freshstartTail 为on 会忽略老的日志。
    
    $ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
    $ModLoad imklog   # provides kernel logging support (previously done by rklogd)
    module(load="imfile" PollingInterval="5")
    $ModLoad imtcp
    $InputTCPServerRun 514
    $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
    $IncludeConfig /etc/rsyslog.d/*.conf
    *.info;mail.none;authpriv.none;cron.none;local5.none                /var/log/messages
    authpriv.*                                              /var/log/secure
    mail.*                                                  -/var/log/maillog
    cron.*                                                  /var/log/cron
    uucp,news.crit                                          /var/log/spooler
    local7.*                                                /var/log/boot.log
    $InputFilePersistStateInterval 1
    input(type="imfile"
    File="/var/log/nginx/access.log"
    Tag="zjzc-frontend01-access"
    PersistStateInterval="1"
    reopenOnTruncate="on"
    freshStartTail="on"
    Severity="info"
    Facility="local5")
    
    
    input(type="imfile"
    File="/var/log/nginx/error.log"
    Tag="zjzc-frontend01-error"
    Severity="info"
    PersistStateInterval="1"
    reopenOnTruncate="on"
    freshStartTail="on"
    Facility="local5")
    local5.* @@115.236.160.82:9514

  • 相关阅读:
    [转]The Machine SID Duplication Myth (and Why Sysprep Matters)
    The Machine SID Duplication Myth (and Why Sysprep Matters)
    [转]Shell(Bash) mysql数据库操作
    [转]GNU Sourcehighlight 语法高亮代码
    [原]DRBD双主模式问题
    mpstat
    DRBD试用
    drbd双主模式问题
    虚IP的添加和删除
    为什么5%的技术人员开发效率是其他95%的20倍?
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6198931.html
Copyright © 2011-2022 走看看