ok ...<br><br>I have it logging to file ... But still not to mysql ... <br><br>this is the back script used to create the pipe <br><br><br>#!/bin/bash <br>#<br># Script to create a named pipe so syslog-ng messages<br># can be sent to a MySQL database
<br>#<br>if [ -p /var/run/mysql.pipe ]; then<br> /usr/bin/mysql -u syslog_ng --password=syslog_ng syslog_ng < /var/run/mysql.pipe &<br>else<br> mkfifo /var/run/mysql.pipe<br>fi<br><br>this is the config file ...
<br><br># syslog-ng configuration file.<br>#<br># This should behave pretty much like the original syslog on RedHat. But<br># it could be configured a lot smarter.<br>#<br># See syslog-ng(8) and syslog-ng.conf(5) for more information.
<br>#<br># 20000925 <a href="mailto:gb@sysfive.com">gb@sysfive.com</a><br>#<br># Updated by Frank Crawford (<<a href="mailto:Frank.Crawford@ac3.com.au">Frank.Crawford@ac3.com.au</a>>) - 10 Aug 2002<br># - for Red Hat
7.3<br># - totally do away with klogd<br># - add message "kernel:" as is done with klogd.<br>#<br># Updated by Frank Crawford (<<a href="mailto:Frank.Crawford@ac3.com.au">Frank.Crawford@ac3.com.au</a>>) - 22 Aug 2002
<br># - use the log_prefix option as per Balazs Scheidler's email<br>#<br># Updated by Jose Pedro Oliveira (<jpo at <a href="http://di.uminho.pt">di.uminho.pt</a>>) - 05 Apr 2003<br># - corrected filters 'f_filter2' and 'f_filter6'
<br># these filters were only allowing messages of one specific<br># priority level; they should be allowing messages from that<br># priority and upper levels.<br>#<br># Updated by Jose Pedro Oliveira (<jpo at
<a href="http://di.uminho.pt">di.uminho.pt</a>>) - 25 Jan 2005<br># - Don't sync the d_mail destination<br>#<br># Updated by Jose Pedro Oliveira (<jpo at <a href="http://di.uminho.pt">di.uminho.pt</a>>) - 01 Feb 2005
<br># - /proc/kmsg is a file not a pipe.<br># (<a href="https://lists.balabit.hu/pipermail/syslog-ng/2005-February/006963.html">https://lists.balabit.hu/pipermail/syslog-ng/2005-February/006963.html</a>)<br>#<br><br>
options {<br># sync (0);<br># time_reopen (10);<br># log_fifo_size (1000);<br># long_hostnames (off);<br># use_dns (no);<br># use_fqdn (no);<br># create_dirs (no);<br> chain_hostnames(no);<br> check_hostname(yes);
<br> keep_hostname (yes);<br>};<br><br>source s_sys {<br> file ("/proc/kmsg" log_prefix("kernel: "));<br> unix-stream ("/dev/log");<br> internal();<br> # udp(ip(<a href="http://0.0.0.0">
0.0.0.0</a>) port(514));<br>};<br><br>destination d_cons { file("/dev/console"); };<br>destination d_mesg { file("/var/syslog-ng/messages"); };<br>destination d_auth { file("/var/syslog-ng/secure"); };
<br>destination d_mail { file("/var/syslog-ng/maillog" sync(10)); };<br>destination d_spol { file("/var/syslog-ng/spooler"); };<br>destination d_boot { file("/var/syslog-ng/boot.log"); };<br>
destination d_cron { file("/var/syslog-ng/cron"); };<br>destination d_mlal { usertty("*"); };<br>destination d_mysql { pipe("/var/run/mysql.pipe"<br> template("INSERT INTO logs (host, facility,
<br> priority, level, tag, date, time, program, msg)<br> VALUES<br> ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL','$TAG',<br> '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM',
<br> '$MSG' );\n") template-escape(yes));<br>};<br><br> <br>filter f_filter1 { facility(kern); };<br>filter f_filter2 { level(info..emerg) and<br> not facility(mail,authpriv,cron); };
<br>filter f_filter3 { facility(authpriv); };<br>filter f_filter4 { facility(mail); };<br>filter f_filter5 { level(emerg); };<br>filter f_filter6 { facility(uucp) or<br> (facility(news) and level(crit..emerg)); };
<br>filter f_filter7 { facility(local7); };<br>filter f_filter8 { facility(cron); };<br><br>log { source(s_sys); filter(f_filter1); destination(d_cons); };<br>log { source(s_sys); filter(f_filter2); destination(d_mesg); };
<br>log { source(s_sys); filter(f_filter3); destination(d_auth); };<br>log { source(s_sys); filter(f_filter4); destination(d_mail); };<br>log { source(s_sys); filter(f_filter5); destination(d_mlal); };<br>log { source(s_sys); filter(f_filter6); destination(d_spol); };
<br>log { source(s_sys); filter(f_filter7); destination(d_boot); };<br>log { source(s_sys); filter(f_filter8); destination(d_cron); };<br># MySQL Database<br><br>log { source(s_sys);<br> filter(f_filter1);<br> filter(f_filter2);
<br> filter(f_filter3);<br> filter(f_filter4);<br> filter(f_filter5);<br> filter(f_filter6);<br> filter(f_filter7);<br> filter(f_filter8);<br> destination(d_mysql); };<br><br>Any ideas on what I have missed ?
<br><br>Many Thanks<br>