[syslog-ng] Problem instert data MSSQL

Bely Silva Junior bjuniow at gmail.com
Wed Dec 14 12:10:07 CET 2011


hi

i have problem when i try insert data in mssql server, when i try run
script, just 2 or 3 lines insert ok, but , insert  stop .

I use pipe, my confs.

destination d_mssql {
    pipe("/var/mssql.syslog-ng.pipe"
   template( "INSERT INTO logs (host, facility, priority, level, tag,
datetime, program, msg ) VALUES (
'$HOST','$FACILITY','$PRIORITY','$LEVEL','$TAG','$YEAR-$MONTH-$DAY
$HOUR:$MIN:$SEC','$PROGRAM','$MSG' );\n" ) template-escape(yes));
  template-escape(yes));
};


log {
      source(s_all);
      destination(d_mssql);
};

my script:

if [ -e /var/mssql.syslog-ng.pipe ]; then
       while [ -e /var/mssql.syslog-ng.pipe ]
                do
                    #isql -v MSSQL "syslogng" "h0hYgbDB6Q" <
/var/mssql.syslog-ng.pipe > /dev/null
                    isql -v MSSQL "syslogng" "h0hYgbDB6Q" <
/var/mssql.syslog-ng.pipe
               done
else

        mkfifo /var/mssql.syslog-ng.pipe
fi



when i try run script:

./syslog2mssql.sh
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> SQLRowCount returns 1
SQL> +------------+
|            |
+------------+
+------------+
SQLRowCount returns 0
SQL> SQLRowCount returns -1
SQL> SQLRowCount returns 1
SQL> [ISQL]ERROR: Could not SQLPrepare
SQL> [ISQL]ERROR: Could not SQLPrepare./syslog2mssql.sh
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> SQLRowCount returns 1
SQL> +------------+
|            |
+------------+
+------------+
SQLRowCount returns 0
SQL> SQLRowCount returns -1
SQL> SQLRowCount returns 1
SQL> [ISQL]ERROR: Could not SQLPrepare
SQL> [ISQL]ERROR: Could not SQLPrepare



someone have idea for this ?


-- 
Bely Silva Junior
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.balabit.hu/pipermail/syslog-ng/attachments/20111214/5ecba395/attachment.htm 


More information about the syslog-ng mailing list