Guest User

Untitled

a guest
Nov 10th, 2015
133
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @version: 3.5
  2. @include "scl.conf"
  3. @include "`scl-root`/system/tty10.conf"
  4.  
  5. # Syslog-ng configuration file, compatible with default Debian syslogd
  6. # installation.
  7.  
  8. # First, set some global options.
  9. options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no);
  10. owner("root"); group("adm"); perm(0640); stats_freq(0);
  11. bad_hostname("^gconfd$");
  12. };
  13.  
  14. ########################
  15. # Sources
  16. ########################
  17. # This is the default behavior of sysklogd package
  18. # Logs may come from unix stream, but not from another machine.
  19. #
  20. source s_src {
  21. system();
  22. internal();
  23. };
  24.  
  25. # If you wish to get logs from remote machine you should uncomment
  26. # this and comment the above source line.
  27. #
  28. #source s_net { tcp(ip(127.0.0.1) port(1000)); };
  29.  
  30. ########################
  31. # Destinations
  32. ########################
  33. # First some standard logfile
  34. #
  35. destination d_auth { file("/var/log/auth.log"); };
  36. destination d_cron { file("/var/log/cron.log"); };
  37. destination d_daemon { file("/var/log/daemon.log"); };
  38. destination d_kern { file("/var/log/kern.log"); };
  39. destination d_lpr { file("/var/log/lpr.log"); };
  40. destination d_mail { file("/var/log/mail.log"); };
  41. destination d_syslog { file("/var/log/syslog"); };
  42. destination d_user { file("/var/log/user.log"); };
  43. destination d_uucp { file("/var/log/uucp.log"); };
  44.  
  45. # This files are the log come from the mail subsystem.
  46. #
  47. destination d_mailinfo { file("/var/log/mail.info"); };
  48. destination d_mailwarn { file("/var/log/mail.warn"); };
  49. destination d_mailerr { file("/var/log/mail.err"); };
  50.  
  51. # Logging for INN news system
  52. #
  53. destination d_newscrit { file("/var/log/news/news.crit"); };
  54. destination d_newserr { file("/var/log/news/news.err"); };
  55. destination d_newsnotice { file("/var/log/news/news.notice"); };
  56.  
  57. # Some `catch-all' logfiles.
  58. #
  59. destination d_debug { file("/var/log/debug"); };
  60. destination d_error { file("/var/log/error"); };
  61. destination d_messages { file("/var/log/messages"); };
  62.  
  63. # The root's console.
  64. #
  65. destination d_console { usertty("root"); };
  66.  
  67. # Virtual console.
  68. #
  69. destination d_console_all { file(`tty10`); };
  70.  
  71. # The named pipe /dev/xconsole is for the nsole' utility. To use it,
  72. # you must invoke nsole' with the -file' option:
  73. #
  74. # $ xconsole -file /dev/xconsole [...]
  75. #
  76. destination d_xconsole { pipe("/dev/xconsole"); };
  77.  
  78. # Send the messages to an other host
  79. #
  80. #destination d_net { tcp("127.0.0.1" port(1000) log_fifo_size(1000)); };
  81.  
  82. # Debian only
  83. destination d_ppp { file("/var/log/ppp.log"); };
  84.  
  85. ########################
  86. # Filters
  87. ########################
  88. # Here's come the filter options. With this rules, we can set which
  89. # message go where.
  90.  
  91. filter f_dbg { level(debug); };
  92. filter f_info { level(info); };
  93. filter f_notice { level(notice); };
  94. filter f_warn { level(warn); };
  95. filter f_err { level(err); };
  96. filter f_crit { level(crit .. emerg); };
  97.  
  98. filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); };
  99. filter f_error { level(err .. emerg) ; };
  100. filter f_messages { level(info,notice,warn) and
  101. not facility(auth,authpriv,cron,daemon,mail,news); };
  102.  
  103. filter f_auth { facility(auth, authpriv) and not filter(f_debug); };
  104. filter f_cron { facility(cron) and not filter(f_debug); };
  105. filter f_daemon { facility(daemon) and not filter(f_debug); };
  106. filter f_kern { facility(kern) and not filter(f_debug); };
  107. filter f_lpr { facility(lpr) and not filter(f_debug); };
  108. filter f_local { facility(local0, local1, local3, local4, local5,
  109. local6, local7) and not filter(f_debug); };
  110. filter f_mail { facility(mail) and not filter(f_debug); };
  111. filter f_news { facility(news) and not filter(f_debug); };
  112. filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); };
  113. filter f_user { facility(user) and not filter(f_debug); };
  114. filter f_uucp { facility(uucp) and not filter(f_debug); };
  115.  
  116. filter f_cnews { level(notice, err, crit) and facility(news); };
  117. filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); };
  118.  
  119. filter f_ppp { facility(local2) and not filter(f_debug); };
  120. filter f_console { level(warn .. emerg); };
  121.  
  122. ########################
  123. # Log paths
  124. ########################
  125. log { source(s_src); filter(f_auth); destination(d_auth); };
  126. log { source(s_src); filter(f_cron); destination(d_cron); };
  127. log { source(s_src); filter(f_daemon); destination(d_daemon); };
  128. log { source(s_src); filter(f_kern); destination(d_kern); };
  129. log { source(s_src); filter(f_lpr); destination(d_lpr); };
  130. log { source(s_src); filter(f_syslog3); destination(d_syslog); };
  131. log { source(s_src); filter(f_user); destination(d_user); };
  132. log { source(s_src); filter(f_uucp); destination(d_uucp); };
  133.  
  134. log { source(s_src); filter(f_mail); destination(d_mail); };
  135. #log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); };
  136. #log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); };
  137. #log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); };
  138.  
  139. log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); };
  140. log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); };
  141. log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); };
  142. #log { source(s_src); filter(f_cnews); destination(d_console_all); };
  143. #log { source(s_src); filter(f_cother); destination(d_console_all); };
  144.  
  145. #log { source(s_src); filter(f_ppp); destination(d_ppp); };
  146.  
  147. log { source(s_src); filter(f_debug); destination(d_debug); };
  148. log { source(s_src); filter(f_error); destination(d_error); };
  149. log { source(s_src); filter(f_messages); destination(d_messages); };
  150.  
  151. log { source(s_src); filter(f_console); destination(d_console_all);
  152. destination(d_xconsole); };
  153. log { source(s_src); filter(f_crit); destination(d_console); };
  154.  
  155. # All messages send to a remote site
  156. #
  157. #log { source(s_src); destination(d_net); };
  158. # move logs from /var/log/syslog to MySQL
  159.  
  160.  
  161. destination d_mysql {
  162. pipe("/var/log/mysql.pipe"
  163. template("INSERT INTO logs
  164. (host, facility, priority, level, tag, datetime, program, msg)
  165. VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG', '$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC', '$PROGRAM', '$MSG');\n") template-escape(yes));
  166. };
  167.  
  168.  
  169. log { source(s_src); destination(d_mysql); };
  170.  
  171. ###
  172. # Include all config files in /etc/syslog-ng/conf.d/
  173. ###
  174. @include "/etc/syslog-ng/conf.d/*.conf"
RAW Paste Data