在Syslog启动之前,Fluentd输入Syslog拥有的所有内容

发布于 2025-02-10 05:04:12 字数 588 浏览 2 评论 0原文

我在ubuntu上有rsyslog配置为将所有内容发送到fluentd,并且可以正常运行,但是从syslog之前,我有/var/log/log/syslog中的日志消息。服务开始,这些日志消息未发送到fluentd。有没有一种方法可以获取Fluentd捡起所有东西?具体来说,我正在尝试拾取内核启动日志(价值约10秒)和Cron的@reboot中的项目。一个适用于/var/log/syslog但不是fluentd的简单CRON作业将是@reboot Logger,这不会发送到Fluentd

fluentd源配置:

<source>
  @type syslog
  port 5140
  bind 0.0.0.0
  tag system
</source>

rsyslog配置在最后添加了此:

*.* @127.0.0.1:5140

I have rsyslog on ubuntu configured to send everything to fluentd, and it works fine, but there are log messages in /var/log/syslog from before syslog.service starts and these log messages are not sent to fluentd. Is there a way to get fluentd to pick up everything? Specifically I am trying to pick up the kernel boot log (about 10 seconds worth) and items from cron's @reboot. A simple cron job that works for /var/log/syslog but not fluentd would be @reboot logger this does not get sent to fluentd.

fluentd source config:

<source>
  @type syslog
  port 5140
  bind 0.0.0.0
  tag system
</source>

rsyslog config has this added at the end:

*.* @127.0.0.1:5140

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一场信仰旅途 2025-02-17 05:04:12

如果要在rsyslog之前开始使用fluentd,请在= syslog.service 行添加到服务文件。

/etc/systemd/system/fluentd.service

[Unit]
Before=syslog.service

[Service]
Type=simple
ExecStart=/usr/local/bin/fluentd

[Install]
WantedBy=multi-user.target

If you want fluentd to start before rsyslog, add Before=syslog.service line to the service file.

/etc/systemd/system/fluentd.service:

[Unit]
Before=syslog.service

[Service]
Type=simple
ExecStart=/usr/local/bin/fluentd

[Install]
WantedBy=multi-user.target
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文