Centos7隐藏messages的slice User信息

本站所有内容来自互联网收集,仅供学习和交流,请勿用于商业用途。如有侵权、不妥之处,请第一时间联系我们删除!Q群:迪思分享

在/var/log/messages中发现大量slice User信息,内容如下

Jan 26 00:01:01 nas systemd: Removed slice User Slice of root.

Jan 26 01:01:01 nas systemd: Created slice User Slice of root.

Jan 26 01:01:01 nas systemd: Started Session 6 of user root.

Jan 26 01:01:01 nas systemd: Removed slice User Slice of root.

Jan 26 02:01:01 nas systemd: Created slice User Slice of root.

Jan 26 02:01:01 nas systemd: Started Session 7 of user root.

Jan 26 02:01:01 nas systemd: Removed slice User Slice of root.

Jan 26 03:01:01 nas systemd: Created slice User Slice of root.

造成大量slice User信息原因是和系统systemd服务有关,可通过配置相关规则,来隐藏这些信息。

隐藏该信息方法:

echo if $programname == “systemd” and ($msg contAIns “Starting Session” or $msg contains “Started Session” or $msg contains “Created slice” or $msg contains “Starting user-” or $msg contains “Starting User Slice of” or $msg contains “Removed session” or $msg contains “Removed slice User Slice of” or $msg contains “Stopping User Slice of”) then stop > /etc/rsyslog.d/ignore-systemd-session-slice.conf systemctl restart rsyslog

重启rsyslog后,该信息不再显示


© 版权声明
THE END
★喜欢这篇文章吗?喜欢的话,麻烦动动手指支持一下!★
点赞12 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容