@version: 3.3
@include "scl.conf"
#@include "`scl-root`/system/tty10.conf"

# First, set some global options.
options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no);
	  owner("root"); group("root"); perm(0664); create_dirs(yes); dir_perm(0755); stats_freq(0);
	  bad_hostname("^gconfd$");
};

########################
# Sources
########################
#source s_local {
#               system();
#               internal();


#};
source s_net {
	syslog (ip(172.16.0.2) transport("tcp") port(514));
};
########################
# Destinations
########################
# standard logfile
#destination d_auth { file("/data/archive/systeme/auth.log"); };
#destination d_cron { file("/data/archive/systeme/cron.log"); };
#destination d_daemon { file("/data/archive/systeme/daemon.log"); };
#destination d_kern { file("/data/archive/systeme/kern.log"); };
#destination d_lpr { file("/data/archive/systeme/lpr.log"); };
#destination d_mail { file("/data/archive/systeme/mail.log"); };
#destination d_syslog { file("/data/archive/systeme/syslog"); };
#destination d_user { file("/data/archive/systeme/user.log"); };
#destination d_uucp { file("/data/archive/systeme/uucp.log"); };
#destination d_mailinfo { file("/data/archive/systeme/mail.info"); };
#destination d_mailwarn { file("/data/archive/systeme/mail.warn"); };
#destination d_mailerr { file("/data/archive/systeme/mail.err"); };
#destination d_newscrit { file("/data/archive/systeme/news.crit"); };
#destination d_newserr { file("/data/archive/systeme/news.err"); };
#destination d_newsnotice { file("/data/archive/systeme/news.notice"); };
#destination d_debug { file("/data/archive/systeme/debug"); };
#destination d_error { file("/data/archive/systeme/error"); };
#destination d_messages { file("/data/archive/systeme/messages"); };
#####################
# Program logfile
destination d_apache_access {file("/data/archive/apache2/${APACHE.VIRTUAL_HOST}_access.log"); };
destination d_apache_portail {file("/data/archive/apache2/imist_access.log"); };
destination d_apache_mjcm {file("/data/archive/apache2/mjcm_access.log"); };
destination d_apache_technolab {file("/data/archive/apache2/technolab_access.log"); };
destination d_apache_geodev {file("/data/archive/apache2/geodev_access.log"); };
destination d_apache_JMSM {file("/data/archive/apache2/jmsm_access.log"); };
destination d_apache_bahtheyya {file("/data/archive/apache2/bahtheyya_access.log"); };
destination d_apache_MM {file("/data/archive/apache2/mm_access.log"); };
destination d_apache_CE {file("/data/archive/apache2/ce_access.log"); };
destination d_apache_RMSP {file("/data/archive/apache2/rmsp_access.log"); };
destination d_apache_JMSR {file("/data/archive/apache2/jmsr_access.log"); };
destination d_apache_MRA {file("/data/archive/apache2/mra_access.log"); };
destination d_apache_morjchem {file("/data/archive/apache2/morjchem_access.log"); };
destination d_apache_JBE {file("/data/archive/apache2/jbe_access.log"); };
destination d_apache_RMPP {file("/data/archive/apache2/rmpp_access.log"); };
destination d_apache_rmt {file("/data/archive/apache2/rmt_access.log"); };
########################
# Filters
########################
# standard filter
#filter f_dbg { level(debug); };
#filter f_info { level(info); };
#filter f_notice { level(notice); };
#filter f_warn { level(warn); };
#filter f_err { level(err); };
#filter f_crit { level(crit .. emerg); };
#filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); };
#filter f_error { level(err .. emerg) ; };
#filter f_messages { level(info,notice,warn) and
#                    not facility(auth,authpriv,cron,daemon,mail,news); };
#filter f_auth { facility(auth, authpriv) and not filter(f_debug); };
#filter f_cron { facility(cron) and not filter(f_debug); };
#filter f_daemon { facility(daemon) and not filter(f_debug); };
#filter f_kern { facility(kern) and not filter(f_debug); };
#filter f_lpr { facility(lpr) and not filter(f_debug); };
#filter f_local { facility(local0, local1, local3, local4, local5,
#                        local6, local7) and not filter(f_debug); };
#filter f_mail { facility(mail) and not filter(f_debug); };
#filter f_news { facility(news) and not filter(f_debug); };
#filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); };
#filter f_user { facility(user) and not filter(f_debug); };
#filter f_uucp { facility(uucp) and not filter(f_debug); };
#filter f_cnews { level(notice, err, crit) and facility(news); };
#filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); };
##############
#programs filter
filter f_apache_access { match("GET" value("MESSAGE")) or match("POST" value("MESSAGE")); };
filter f_mjcm { match("MJCM" value("MESSAGE")); };
filter f_technolab { match("technolab" value("MESSAGE")); };
filter f_geodev { match("geodev" value("MESSAGE")); };
filter f_JMSM { match("JMSM" value("MESSAGE")); };
filter f_bahtheyya { match("bahtheyya" value("MESSAGE")); };
filter f_MM { match("journal=MM" value("MESSAGE")); };
filter f_CE { match("journal=CE" value("MESSAGE")); };
filter f_RMSP { match("journal=RMSP" value("MESSAGE")); };
filter f_JMSR { match("journal=JMSR" value("MESSAGE")); };
filter f_MRA { match("journal=MRA" value("MESSAGE")); };
filter f_morjchem { match("journal=morjchem" value("MESSAGE")); };
filter f_JBE { match("journal=JBE" value("MESSAGE")); };
filter f_RMPP { match("journal=RMPP" value("MESSAGE")); };
filter f_rmt { match("journal=rmt" value("MESSAGE")); };
#####################
#parser apache
parser p_apache {

    csv-parser(columns("APACHE.VIRTUAL_HOST", "APACHE.CLIENT_IP", "APACHE.IDENT_NAME", "APACHE.USER_NAME",

        "APACHE.TIMESTAMP", "APACHE.REQUEST_URL", "APACHE.REQUEST_STATUS",

        "APACHE.CONTENT_LENGTH", "APACHE.REFERER", "APACHE.USER_AGENT",

        "APACHE.PROCESS_TIME", "APACHE.SERVER_NAME")

         flags(escape-double-char,strip-whitespace)

         delimiters(" ")

         quote-pairs('""[]')

         );

};
########################
# Log paths
########################
# standard logpaths
#log { source(s_local); source(s_net); filter(f_auth); destination(d_auth); };
#log { source(s_local); source(s_net); filter(f_cron); destination(d_cron); };
#log { source(s_local); source(s_net); filter(f_daemon); destination(d_daemon); };
#log { source(s_local); source(s_net); filter(f_kern); destination(d_kern); };
#log { source(s_local); source(s_net); filter(f_lpr); destination(d_lpr); };
#log { source(s_local); source(s_net); filter(f_syslog3); destination(d_syslog); };
#log { source(s_local); source(s_net); filter(f_user); destination(d_user); };
#log { source(s_local); source(s_net); filter(f_uucp); destination(d_uucp); };
#log { source(s_local); source(s_net); filter(f_mail); destination(d_mail); };
#log { source(s_local); source(s_net); filter(f_mail); filter(f_info); destination(d_mailinfo); };
#log { source(s_local); source(s_net); filter(f_mail); filter(f_warn); destination(d_mailwarn); };
#log { source(s_local); source(s_net); filter(f_mail); filter(f_err); destination(d_mailerr); };
#log { source(s_local); source(s_net); filter(f_news); filter(f_crit); destination(d_newscrit); };
#log { source(s_local); source(s_net); filter(f_news); filter(f_err); destination(d_newserr); };
#log { source(s_local); source(s_net); filter(f_news); filter(f_notice); destination(d_newsnotice); };
#log { source(s_local); source(s_net); filter(f_debug); destination(d_debug); };
#log { source(s_local); source(s_net); filter(f_error); destination(d_error); };
#log { source(s_local); source(s_net); filter(f_messages); destination(d_messages); };

# Program logpaths
log { source(s_net); filter(f_apache_access); parser(p_apache); destination(d_apache_access);};
log { source(s_net); filter(f_apache_access); destination(d_apache_portail); flags(flow-control); };
log { source(s_net); filter(f_apache_access); filter (f_mjcm); destination(d_apache_mjcm);};
log { source(s_net); filter(f_apache_access); filter (f_technolab); destination(d_apache_technolab);};
log { source(s_net); filter(f_apache_access); filter (f_geodev); destination(d_apache_geodev);};
log { source(s_net); filter(f_apache_access); filter (f_JMSM); destination(d_apache_JMSM);};
log { source(s_net); filter(f_apache_access); filter (f_bahtheyya); destination(d_apache_bahtheyya);};
log { source(s_net); filter(f_apache_access); filter (f_MM); destination(d_apache_MM);};
log { source(s_net); filter(f_apache_access); filter (f_CE); destination(d_apache_CE);};
log { source(s_net); filter(f_apache_access); filter (f_RMSP); destination(d_apache_RMSP);};
log { source(s_net); filter(f_apache_access); filter (f_JMSR); destination(d_apache_JMSR);};
log { source(s_net); filter(f_apache_access); filter (f_MRA); destination(d_apache_MRA);};
log { source(s_net); filter(f_apache_access); filter (f_morjchem); destination(d_apache_morjchem);};
log { source(s_net); filter(f_apache_access); filter (f_JBE); destination(d_apache_JBE); };
log { source(s_net); filter(f_apache_access); filter (f_RMPP); destination(d_apache_RMPP);};
log { source(s_net); filter(f_apache_access); filter (f_rmt); destination(d_apache_rmt);};
###
# Include all config files in /etc/syslog-ng/conf.d/
###
@include "/etc/syslog-ng/conf.d/"

