0
0

More than 1 year has passed since last update.

Syslog-ng3.33 conf on RHEL7

Last updated at Posted at 2021-10-25

前回インストールは済みましたが
今度はconfで引っ掛かりました

ようやくたどり着いた公式参照

RHEL7では自動でsystemd-journal()が使われるように書かれているが
インストールがコケているのかエラーしか吐かなかった

I got stack again.
This time was conf.
I couldn't see dhcp demon log on syslog.

I was using this conf on Centos5 and syslog-ng2.
CentOS5とsyslog-ng2では以下のconfで動いていた

source s_sys {
        file ("/proc/kmsg" log_prefix("kernel: "));
        unix-stream ("/dev/log");
        internal();
        udp(ip(0.0.0.0) port(514));
        tcp(ip(0.0.0.0) port(514));
};

filter f_local1 { facility(local1); };
log { source(s_sys); filter(f_local1); destination(d_dhcp_log); };
destination d_dhcp_log { file("/var/log/$YEAR$MONTH$DAY.dhcp.log"); };

but I got error below on source section.
confチェックをするとエラー

$ syslog-ng -s -f /etc/syslog-ng/syslog-ng.conf

Using /dev/log Unix socket with systemd is not possible.
Changing to systemd-syslog source, witch supports socket activation.;

So I searched a lot and found out that cannot use
/dev/log on syslog-ng 3.33.
systemd-journal();を使えばdhcpのlogを吐きました

a correct source setting is bellow.

source s_sys {
        file ("/proc/kmsg" log_prefix("kernel: "));
        #unix-stream ("/dev/log");
        systemd-journal(); # <- this is correct
        internal();
        udp(ip(0.0.0.0) port(514));
        tcp(ip(0.0.0.0) port(514));
};

どなたかの一助になれば
I hope this can help someone. :)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0