Guest User

syslog-ng.conf

a guest
Nov 27th, 2016
619
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 6.11 KB | None | 0 0
  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. #Redis destination
  45. destination d_redis {
  46.   redis( host("127.0.0.1")
  47.          port(6379)
  48.          command("SET", "help", "what"));
  49. };
  50.  
  51.  
  52.  
  53. # This files are the log come from the mail subsystem.
  54. #
  55. destination d_mailinfo { file("/var/log/mail.info"); };
  56. destination d_mailwarn { file("/var/log/mail.warn"); };
  57. destination d_mailerr { file("/var/log/mail.err"); };
  58.  
  59. # Logging for INN news system
  60. #
  61. destination d_newscrit { file("/var/log/news/news.crit"); };
  62. destination d_newserr { file("/var/log/news/news.err"); };
  63. destination d_newsnotice { file("/var/log/news/news.notice"); };
  64.  
  65. # Some `catch-all' logfiles.
  66. #
  67. destination d_debug { file("/var/log/debug"); };
  68. destination d_error { file("/var/log/error"); };
  69. destination d_messages { file("/var/log/messages"); };
  70.  
  71. # The root's console.
  72. #
  73. destination d_console { usertty("root"); };
  74.  
  75. # Virtual console.
  76. #
  77. destination d_console_all { file(`tty10`); };
  78.  
  79. # The named pipe /dev/xconsole is for the nsole' utility.  To use it,
  80. # you must invoke nsole' with the -file' option:
  81. #
  82. #    $ xconsole -file /dev/xconsole [...]
  83. #
  84. destination d_xconsole { pipe("/dev/xconsole"); };
  85.  
  86. # Send the messages to an other host
  87. #
  88. #destination d_net { tcp("127.0.0.1" port(1000) log_fifo_size(1000)); };
  89.  
  90. # Debian only
  91. destination d_ppp { file("/var/log/ppp.log"); };
  92.  
  93. ########################
  94. # Filters
  95. ########################
  96. # Here's come the filter options. With this rules, we can set which
  97. # message go where.
  98.  
  99. filter f_dbg { level(debug); };
  100. filter f_info { level(info); };
  101. filter f_notice { level(notice); };
  102. filter f_warn { level(warn); };
  103. filter f_err { level(err); };
  104. filter f_crit { level(crit .. emerg); };
  105.  
  106. filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); };
  107. filter f_error { level(err .. emerg) ; };
  108. filter f_messages { level(info,notice,warn) and
  109.                     not facility(auth,authpriv,cron,daemon,mail,news); };
  110.  
  111. filter f_auth { facility(auth, authpriv) and not filter(f_debug); };
  112. filter f_cron { facility(cron) and not filter(f_debug); };
  113. filter f_daemon { facility(daemon) and not filter(f_debug); };
  114. filter f_kern { facility(kern) and not filter(f_debug); };
  115. filter f_lpr { facility(lpr) and not filter(f_debug); };
  116. filter f_local { facility(local0, local1, local3, local4, local5,
  117.                         local6, local7) and not filter(f_debug); };
  118. filter f_mail { facility(mail) and not filter(f_debug); };
  119. filter f_news { facility(news) and not filter(f_debug); };
  120. filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); };
  121. filter f_user { facility(user) and not filter(f_debug); };
  122. filter f_uucp { facility(uucp) and not filter(f_debug); };
  123.  
  124. filter f_cnews { level(notice, err, crit) and facility(news); };
  125. filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); };
  126.  
  127. filter f_ppp { facility(local2) and not filter(f_debug); };
  128. filter f_console { level(warn .. emerg); };
  129.  
  130. ########################
  131. # Log paths
  132. ########################
  133. log { source(s_src); filter(f_auth); destination(d_auth); };
  134. log { source(s_src); filter(f_cron); destination(d_cron); };
  135. log { source(s_src); filter(f_daemon); destination(d_daemon); };
  136. log { source(s_src); filter(f_kern); destination(d_kern); };
  137. log { source(s_src); filter(f_lpr); destination(d_lpr); };
  138. log { source(s_src); filter(f_syslog3); destination(d_syslog); };
  139. log { source(s_src); filter(f_user); destination(d_user); };
  140. log { source(s_src); filter(f_uucp); destination(d_uucp); };
  141.  
  142. log { source(s_src); filter(f_mail); destination(d_mail); };
  143. #log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); };
  144. #log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); };
  145. #log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); };
  146.  
  147. log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); };
  148. log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); };
  149. log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); };
  150. #log { source(s_src); filter(f_cnews); destination(d_console_all); };
  151. #log { source(s_src); filter(f_cother); destination(d_console_all); };
  152.  
  153. #log { source(s_src); filter(f_ppp); destination(d_ppp); };
  154.  
  155. log { source(s_src); filter(f_debug); destination(d_debug); };
  156. log { source(s_src); filter(f_error); destination(d_error); };
  157. log { source(s_src); filter(f_messages); destination(d_messages); };
  158.  
  159. log { source(s_src); filter(f_console); destination(d_console_all);
  160.                     destination(d_xconsole); };
  161. log { source(s_src); filter(f_crit); destination(d_console); };
  162.  
  163. # All messages send to a remote site
  164. #
  165. #log { source(s_src); destination(d_net); };
  166.  
  167. ###
  168. # Include all config files in /etc/syslog-ng/conf.d/
  169. ###
  170. @include "/etc/syslog-ng/conf.d/*.conf"
Add Comment
Please, Sign In to add comment