Hi All, Iam writing syslog-ng entries in to database by configuring in syslog-ng.conf like below destination d_oracle { pipe("/dev/ora.pipe" template ("INSERT INTO logs (LL_HOST, LL_facility, LL_priority,LL_level, LL_tag,LL_DATE, LL_program, LL_msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY','$LEVEL', '$TAG',to_date('$YEAR.$MONTH.$DAY $HOUR:$MIN:$SEC', 'yyyy.mm.dd hh24:mi:ss'),'$PROGRAM', substrc('$MSG',1,511));\n COMMIT;\n") template-escape(yes)); }; Iam writting logs from pipe to database.Iam using below script. nohup sqlplus UNAME/PWORD@IPADDRESS/orcl @/dev/ora.pipe > /dev/null &. Sometimes pipe is getting blocked.one reason we are suspecting is DB server restarting.How to handle these situations.Even the DB server restarting the script process is alive but it is not writing to DB. vijay
Try writing a program destination driver to sqlplus instead of using a named pipe. Without knowing exactly what is happening, I dont know if this will accomplish anything. Also, this would seem to be something you'd need to take up with oracle as it would seem sqlplus is as fault for not handling a disconnect, not syslog-ng. A more graceful solution would be to use the sql destination driver, which has the ability to reconnect if the connection is terminated. -Patrick Sent: Wed Nov 10 2010 10:23:54 GMT-0700 (Mountain Standard Time) From: vijay <bhaskarpeddi@gmail.com> To: Syslog-ng users' and developers' mailing list <syslog-ng@lists.balabit.hu> Subject: [syslog-ng] writing to Database
Hi All,
Iam writing syslog-ng entries in to database by configuring in syslog-ng.conf like below
destination d_oracle { pipe("/dev/ora.pipe" template ("INSERT INTO logs (LL_HOST, LL_facility, LL_priority,LL_level, LL_tag,LL_DATE, LL_program, LL_msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY','$LEVEL', '$TAG',to_date('$YEAR.$MONTH.$DAY $HOUR:$MIN:$SEC', 'yyyy.mm.dd hh24:mi:ss'),'$PROGRAM', substrc('$MSG',1,511));\n COMMIT;\n") template-escape(yes)); };
Iam writting logs from pipe to database.Iam using below script.
nohup sqlplus UNAME/PWORD@IPADDRESS/orcl @/dev/ora.pipe > /dev/null &.
Sometimes pipe is getting blocked.one reason we are suspecting is DB server restarting.How to handle these situations.Even the DB server restarting the script process is alive but it is not writing to DB.
vijay ______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.campin.net/syslog-ng/faq.html
participants (2)
-
Patrick H.
-
vijay