[syslog-ng] create_dir and "dynamic" destinations.

Scot Needy scotrn at gmail.com
Wed Aug 20 13:11:49 CEST 2014



  I was wondering if anyone has tried to work around syslog_ng. My destinations are psudo dynamic in that I have one per subnet but I don’t want to pre-create every destination directory until a syslog message is received for that destination. 

I have 3 conf files (Dfilters.conf Ddestination.conf and Dlog.conf ) that are built using an API to our IPNMS (IP Network Management System). The purpose is to use syslog-ng stats to quickly report on subnets and also provide per-subnet options for reporting, forwarding …  

Example Destination 
	destination d_192_168_9_0 { file(/opt/syslog-ng/logs/192_168_9_0/$YEAR$MONTH$DAY.$HOST.log);};

Example Filter 
	filter f_192_168_9_0 { netmask(;};

Example Log 
	log { source(s_net); filter(f_192_168_9_0); destination(d_192_168_9_0);};

My question is can anyone think of a way to get the create_dir option to dynamically create my subnet directories as needed ?  
For now I Need to pre-create every directory or syslog-ng complains which causes me to create a bunch of empty directories. 


More information about the syslog-ng mailing list