【问题标题】:Rsyslog: imfile does not switch to inotify modeRsyslog:imfile 没有切换到 inotify 模式
【发布时间】:2016-12-05 18:22:31
【问题描述】:

我正在尝试将多个 nginx 日志发送到 loggly... 配置文件:/etc/rsyslog.d/21-nginx.conf

$ModLoad imfile
    #$InputFilePollInterval 10
    $InputFileMode inotify
    $WorkDirectory /var/spool/rsyslog
    $PrivDropToGroup adm

    # nginx access file:
    $InputFileName /var/log/nginx/*access.log
    $InputFileTag nginx-access:
    $InputFileStateFile stat-nginx-access
    $InputFileSeverity info
    $InputFilePersistStateInterval 20000
    $InputRunFileMonitor

    # other stuff continues......

重新启动后,我在日志系统日志中收到此错误:

imfile: The to-be-monitored file "/var/log/nginx/*access.log" contains wildcards. This is not supported in polling mode. [v8.16.0 try http://www.rsyslog.com/e/2420 ]
activation of module imfile failed [v8.16.0 try http://www.rsyslog.com/e/-3 ]

我是不是做错了什么?

【问题讨论】:

    标签: nginx rsyslog loggly


    【解决方案1】:

    您的 rsyslog 配置中是否有其他地方文件模式更改为拉取或文件轮询间隔处于活动状态?使用这种遗留语法的问题是所有配置都是全局加载的,因此其他配置文件中的内容可以交互。您可能会考虑使用新的操作语法,以便将 inotify 模式应用于特定源。你可以在这里看到一个例子http://www.rsyslog.com/doc/v8-stable/configuration/modules/imfile.html

    【讨论】:

      猜你喜欢
      • 2012-10-13
      • 2015-08-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-03
      • 1970-01-01
      • 2013-02-20
      • 1970-01-01
      相关资源
      最近更新 更多