[syslog-ng] writing to Database

vijay bhaskarpeddi at gmail.com
Wed Nov 10 18:23:54 CET 2010


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 at 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


More information about the syslog-ng mailing list