Jayen
Jayen

Reputation: 6079

fluentd input everything that syslog has, before syslog starts

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

Upvotes: 1

Views: 177

Answers (1)

Jayen
Jayen

Reputation: 6079

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

Upvotes: 0

Related Questions