首页 > 解决方案 > 过滤系统日志 Busybox 消息

问题描述

我正在尝试设置 BusyBox 系统日志以将消息发送到远程系统日志服务器。我更改了 syslog 配置文件 /etc/syslog-startup.conf.busybox,如下所示:

DESTINATION=remote      # log destinations (buffer file remote)
#LOGFILE=/var/log/messages  # where to log (file)
REMOTE=192.168.8.166:514    # where to log (syslog remote)
REDUCE=no           # reduce-size logging
DROPDUPLICATES=no       # whether to drop duplicate log entries
#ROTATESIZE=0           # rotate log if grown beyond X [kByte]
#ROTATEGENS=3           # keep X generations of rotated logs
BUFFERSIZE=64           # size of circular buffer [kByte]
FOREGROUND=no           # run in foreground (don't use!)
#LOGLEVEL=5         # local log level (between 1 and 8)

通过这样的配置,系统成功地将日志消息发送到远程 syslog 服务器。我想只向远程系统日志服务器发送有关用户登录和注销的消息,并丢弃所有其他类型的日志。我尝试添加:

authpriv.notice @192.168.8.166:514

或者:

:msg, contains, "login"  ~

但它不起作用。我认为这应该是可能的,但我真的不知道如何编辑该文件以过滤身份验证消息以发送到服务器。谢谢

标签: authenticationfiltersyslogbusybox

解决方案


推荐阅读