@version: 3.1
#
# Syslog-ng configuration file, compatible with default Debian syslogd
# installation. Originally written by anonymous (I can't find his name)
# Revised, and rewrited by me (SZALAY Attila <sasa@debian.org>)

# First, set some global options.
options { long_hostnames(on); keep_hostname(on); flush_lines(0); use_dns(yes); use_fqdn(yes);
	  owner("root"); group("adm"); perm(0640); stats_freq(0);
	  bad_hostname("^gconfd$");
};

source s_local { unix-stream("/dev/log"); };


# tell syslog-ng which file to use as a parser for the incoming messages
parser p_error_proof
{
  db_parser
  (
    file("/etc/syslog-ng/pattern_rules.xml")
  );
};


filter f_id_1
{
  match
  (
	"1"
	value("Id")
	type("string")
  );
};

destination d_id_1_matched
{
  file
  (
        /var/log/message_with_id_matched
	owner(root)
	group(adm)
	perm(0600)
	dir_perm(0700)
	create_dirs(yes)
  );
};


destination d_all_messages
{
  file
  (
        /var/log/messages
	owner(root)
	group(adm)
	perm(0600)
	dir_perm(0700)
	create_dirs(yes)
  );
};



log
{
	source(s_local);
	parser(p_error_proof);
	filter(f_id_1);
	destination(d_id_1_matched);
};


log
{
	source(s_local);
	destination(d_all_messages);
};
