【问题标题】:Rsyslog imfile error: no file name givenRsyslog imfile 错误:没有给出文件名
【发布时间】:2018-06-02 14:51:58
【问题描述】:

我在 ubuntu 16.04 上使用 rsyslog 版本 8.16.0。

以下是我的配置文件:

module(load="imfile") #needs to be done just once

# File 1
input(type="imfile"
  mode="inotify"
  File="/var/log/application/hello.log"
  Tag="application-access-logs"
  Severity="info"
  PersistStateInterval="20000"
)

$PrivDropToGroup adm
$WorkDirectory /var/spool/rsyslog
$InputRunFileMonitor

#Template for application access events
$template ApplicationLogs,"%HOSTNAME% %msg%\n"


if $programname == 'application-access-logs' then @@xx.xx.xx.xx:12345;ApplicationLogs
if $programname == 'application-access-logs' then ~

我收到以下错误:

rsyslogd: version 8.16.0, config validation run (level 1), master config /etc/rsyslog.conf
rsyslogd: error during parsing file /etc/rsyslog.d/21-application-test.conf, on or before line 10: parameter 'mode' not known -- typo in config file? [v8.16.0 try http://www.rsyslog.com/e/2207 ]
rsyslogd: imfile error: no file name given, file monitor can not be created [v8.16.0 try http://www.rsyslog.com/e/2046 ]

我在这里做错了什么? 我正在使用inotify 模式,因为我想在文件名中使用通配符。

【问题讨论】:

  • 您找到解决方案了吗?

标签: rsyslog


【解决方案1】:

我知道这不是一个完整的答案,而是一个可以帮助其他人解决同样问题的观察结果。

module(load="imfile" mode="inotify") 是全局设置的,因此如果任何其他 .conf 文件设置了模块属性,它似乎会为以后的任何文件抛出此错误。

【讨论】:

    猜你喜欢
    • 2018-10-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多