[syslog-ng]separating logs by hostname
A.L.Lambert
alambert@manisec.com
Thu, 14 Jun 2001 12:21:50 -0500 (CDT)
> I keep reading that syslog-ng has the capability to divert into
> different log files based on hostname. I'm doing this with an older
> version by manually specifying for each machine as shown below. I'd
> like to avoid mucking with the config file every time we add or remove
> a machine (all the time). I've downloaded 1.5.7, but can't find any
> examples of this. Is there a simple way to do this or do I need to
> just add an entry for every new host?
>
> filter f_shaggy { host(shaggy); };
> destination d_shaggy { file("/var/syslog-ng/shaggy"); };
> log { source(src);
> filter(f_shaggy);
> destination(d_shaggy);
> };
destination d_auto { file("/var/syslog-ng/$HOST"); };
If I recall correctly. :) I forget where, but somewhere in the
documentation is a list of all the allowed variables. You can also use
this feature in conjunction with "create_dirs(on);" to build directory
trees like "/var/syslog-ng/$YEAR/$MONTH/$DAY/$HOST/$FACILITY.$PRIORITY"
etc.
Cheers!
--
A.L.Lambert
------------------------------------------------------------------------
Everything should be made as simple as possible, but not simpler.
-Einstein
------------------------------------------------------------------------