View previous topic :: View next topic |
Author |
Message |
ferreirafm Guru
Joined: 28 Jul 2005 Posts: 487 Location: Sao Paulo, Brazil
|
Posted: Fri Jan 04, 2013 1:32 pm Post subject: [SOLVED] help with syslog-ng wanted |
|
|
Hi Forum,
I would like to send the SMART log messages to a separate file instead of to /var/log/messages.
From the SMART manpages it seems very simple task using the SYSLOG daemon. However, the default Gentoo syslog program is the SYSLOG-NG, which is pretty difficult to config.
Please, could some syslog-ng expert give me a hand?
Best
Last edited by ferreirafm on Mon Jan 07, 2013 1:08 pm; edited 1 time in total |
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6639 Location: The soundosphere
|
|
Back to top |
|
|
gentoo_ram Guru
Joined: 25 Oct 2007 Posts: 474 Location: San Diego, California USA
|
Posted: Sun Jan 06, 2013 6:21 pm Post subject: |
|
|
You want to use filters. I'm going to assume the SMART messages are from the program "smartd".
Code: |
source src { unix-stream("/dev/log" max-connections(256));
internal(); file("/proc/kmsg"); udp6(keep_timestamp(no));
tcp6(keep_timestamp(no)); };
filter messagesf { not program("smartd"); };
filter smartf { program("smartd"); };
destination messages { file("/var/log/messages"); };
destination smartlog { file("/var/log/smartd"); };
log { source(src); filter(messagesf); destination(messages); };
log { source(src); filter(smartf); destination(smartlog); };
|
|
|
Back to top |
|
|
ferreirafm Guru
Joined: 28 Jul 2005 Posts: 487 Location: Sao Paulo, Brazil
|
Posted: Mon Jan 07, 2013 1:19 pm Post subject: |
|
|
Both suggestions helped. Just to clarify, audiodef suggestion will separate most of the daemon logfiles from messages. At least in my case, I still had to edit syslog-ng according to gentoo_ram.
All the Best. |
|
Back to top |
|
|
|