rsyslog将数据发送到同一服务器,显示模块

时间:2016-08-29 08:43:00

标签: rsyslog

我的应用正在

下生成日志

/var/log/myapp/app.log

我需要将app.log下的所有日志发送到我的syslog文件/ var / log / syslog。

我创建了一个包含以下内容的文件/etc/rsyslog.d

$WorkDirectory /var/spool/rsyslog
$template RFC3164fmt,"<%PRI%>%TIMESTAMP% %HOSTNAME% %syslogtag%%msg%"

# Log shipment rsyslog target servers
$ActionQueueFileName appfile
$ActionQueueSaveOnShutdown on
$ActionQueueType LinkedList
$ActionResumeRetryCount 250
*.* @10.x.x.1;RFC3164fmt



# Log files
$InputFileName /var/log/myapp/app.log
$InputFileTag app:
$InputFileStateFile state-app
$InputFileFacility local7
$InputFilePollInterval 1
$InputFilePersistStateInterval 1
$InputRunFileMonitor

10.x.x.1与安装rsyslog且我的应用程序正在运行的节点相同。

一旦我重新启动rsyslog,就会在syslog文件中出现以下错误

invalid or yet-unknown config file command 'InputFileName' - have you forgotten to load a module? [try http://www.rsyslog.com/e/3003 ]
invalid or yet-unknown config file command 'InputFileTag' - have you forgotten to load a module? [try http://www.rsyslog.com/e/3003 ]
invalid or yet-unknown config file command 'InputFileStateFile' - have you forgotten to load a module? [try http://www.rsyslog.com/e/3003 ]
invalid or yet-unknown config file command 'InputFileFacility' - have you forgotten to load a module? [try http://www.rsyslog.com/e/3003 ]
invalid or yet-unknown config file command 'InputFilePollInterval' - have you forgotten to load a module? [try http://www.rsyslog.com/e/3003 ]
invalid or yet-unknown config file command 'InputFilePersistStateInterval' - have you forgotten to load a module? [try http://www.rsyslog.com/e/3003 ]
invalid or yet-unknown config file command 'InputRunFileMonitor' - have you forgotten to load a module? [try http://www.rsyslog.com/e/3003 ]

我还检查了几个SO链接并更改了我的/etc/rsyslog.conf文件条目以更改用户。但我

#$PrivDropToUser syslog
$PrivDropToUser appuser
#$PrivDropToGroup syslog
$PrivDropToGroup appuser

1 个答案:

答案 0 :(得分:0)

我错过了加载模块。

在开头添加以下行解决了问题

library(lubridate)
with(x, mdy_hms(paste(date, time)))
#[1] "2007-01-02 00:00:02 UTC"