Syslog-ng 3.0.7 fails to insert into microsoft sql server
Dear All, Im currently configuring syslog-ng on SUSE Linux 10 SP2 to communicate with microsoft sql server 2005. I have installed freeTds 8.0. Tested TSQL ..works fine ISQL works fine. when testing with syslog-ng Conf file destination d_mssql { sql(type(mssql) host("ip address") port("1433") username("sa") password("password") database("syslogng") table("test1") columns("datetime varchar(16)","host varchar(32)" ,"program varchar(32)","pid varchar(8)","message varchar(4096)") values("$R_DATE", "$HOST", "$PROGRAM", "$PID", "$MSGONLY") indexes() ); }; log { source(src); destination(d_mssql); }; I get the following error Note I created the table test1 manually in SQL server Code: Jul 12 09:57:06 syslogng syslog-ng[25034]: Error running SQL query; type='freetds', host='ip address', port='1433', user='sa', database='syslogng', error='', query='INSERT INTO test1 (datetime, host, program, pid, message) VALUES (\'Jul 12 08:59:46\', \'syslogng\', \'agetty\', \'25154\', \'/dev/xvc0: No such file or directory\')' Jul 12 09:57:36 syslogng syslog-ng[25034]: Error opening pipe, underlying file is not a FIFO, it should be used by file(); filename='/dev/tty10' Jul 12 09:57:36 syslogng syslog-ng[25034]: Error opening file for writing; filename='/dev/tty10', error='Illegal seek (29)' Jul 12 09:59:06 syslogng syslog-ng[25034]: Error running SQL query; type='freetds', host='ip address', port='1433', user='sa', database='syslogng', error='', query='INSERT INTO test1 (datetime, host, program, pid, message) VALUES (\'Jul 12 08:59:46\', \'syslogng\', \'agetty\', \'25154\', \'/dev/xvc0: No such file or directory\')' Jul 12 09:59:06 syslogng syslog-ng[25034]: Error inserting message into database. It is tried to insert 3 times, but it's failed. Message is dropped; Grateful if someone can help me figure out the problem Regards KP
On Mon, 2010-07-12 at 16:02 +0400, Khaleelah Peerbocus wrote:
Dear All,
Im currently configuring syslog-ng on SUSE Linux 10 SP2 to communicate with microsoft sql server 2005.
I have installed freeTds 8.0.
Tested TSQL ..works fine ISQL works fine.
when testing with syslog-ng
Conf file
destination d_mssql {
sql(type(mssql) host("ip address") port("1433")
username("sa") password("password") database("syslogng")
table("test1")
columns("datetime varchar(16)","host varchar(32)" ,"program varchar(32)","pid varchar(8)","message varchar(4096)")
values("$R_DATE", "$HOST", "$PROGRAM", "$PID", "$MSGONLY")
indexes()
);
};
log {
source(src);
destination(d_mssql);
};
I get the following error
Note I created the table test1 manually in SQL server
Code:
Jul 12 09:57:06 syslogng syslog-ng[25034]: Error running SQL query; type='freetds', host='ip address', port='1433', user='sa', database='syslogng', error='', query='INSERT INTO test1 (datetime, host, program, pid, message) VALUES (\'Jul 12 08:59:46\', \'syslogng \', \'agetty\', \'25154\', \'/dev/xvc0: No such file or directory\')'
Jul 12 09:57:36 syslogng syslog-ng[25034]: Error opening pipe, underlying file is not a FIFO, it should be used by file(); filename='/dev/tty10'
Jul 12 09:57:36 syslogng syslog-ng[25034]: Error opening file for writing; filename='/dev/tty10', error='Illegal seek (29)'
Jul 12 09:59:06 syslogng syslog-ng[25034]: Error running SQL query; type='freetds', host='ip address', port='1433', user='sa', database='syslogng', error='', query='INSERT INTO test1 (datetime, host, program, pid, message) VALUES (\'Jul 12 08:59:46\', \'syslogng \', \'agetty\', \'25154\', \'/dev/xvc0: No such file or directory\')'
Jul 12 09:59:06 syslogng syslog-ng[25034]: Error inserting message into database. It is tried to insert 3 times, but it's failed. Message is dropped;
Grateful if someone can help me figure out the problem
hmm, does the syslog-ng user have the required permissions to insert into the table? strange that the error="" clause is empty in the log message. The other error message is unrelated, /dev/tty10 should be opened with the file() driver. -- Bazsi
The user has all the permissions. That's why I have tried the other way round using Pipe. But still in vain -----Original Message----- From: syslog-ng-bounces@lists.balabit.hu [mailto:syslog-ng-bounces@lists.balabit.hu] On Behalf Of Balazs Scheidler Sent: Tuesday, July 13, 2010 2:52 PM To: Syslog-ng users' and developers' mailing list Subject: Re: [syslog-ng] Syslog-ng 3.0.7 fails to insert into microsoft sql server On Mon, 2010-07-12 at 16:02 +0400, Khaleelah Peerbocus wrote:
Dear All,
Im currently configuring syslog-ng on SUSE Linux 10 SP2 to communicate with microsoft sql server 2005.
I have installed freeTds 8.0.
Tested TSQL ..works fine ISQL works fine.
when testing with syslog-ng
Conf file
destination d_mssql {
sql(type(mssql) host("ip address") port("1433")
username("sa") password("password") database("syslogng")
table("test1")
columns("datetime varchar(16)","host varchar(32)" ,"program varchar(32)","pid varchar(8)","message varchar(4096)")
values("$R_DATE", "$HOST", "$PROGRAM", "$PID", "$MSGONLY")
indexes()
);
};
log {
source(src);
destination(d_mssql);
};
I get the following error
Note I created the table test1 manually in SQL server
Code:
Jul 12 09:57:06 syslogng syslog-ng[25034]: Error running SQL query; type='freetds', host='ip address', port='1433', user='sa', database='syslogng', error='', query='INSERT INTO test1 (datetime, host, program, pid, message) VALUES (\'Jul 12 08:59:46\', \'syslogng \', \'agetty\', \'25154\', \'/dev/xvc0: No such file or directory\')'
Jul 12 09:57:36 syslogng syslog-ng[25034]: Error opening pipe, underlying file is not a FIFO, it should be used by file(); filename='/dev/tty10'
Jul 12 09:57:36 syslogng syslog-ng[25034]: Error opening file for writing; filename='/dev/tty10', error='Illegal seek (29)'
Jul 12 09:59:06 syslogng syslog-ng[25034]: Error running SQL query; type='freetds', host='ip address', port='1433', user='sa', database='syslogng', error='', query='INSERT INTO test1 (datetime, host, program, pid, message) VALUES (\'Jul 12 08:59:46\', \'syslogng \', \'agetty\', \'25154\', \'/dev/xvc0: No such file or directory\')'
Jul 12 09:59:06 syslogng syslog-ng[25034]: Error inserting message into database. It is tried to insert 3 times, but it's failed. Message is dropped;
Grateful if someone can help me figure out the problem
hmm, does the syslog-ng user have the required permissions to insert into the table? strange that the error="" clause is empty in the log message. The other error message is unrelated, /dev/tty10 should be opened with the file() driver. -- Bazsi ____________________________________________________________________________ __ 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
On Tue, 2010-07-13 at 15:04 +0400, Khaleelah Peerbocus wrote:
The user has all the permissions. That's why I have tried the other way round using Pipe.
But still in vain
I've helped with your other case, but I really think that it should work with mssql as well. We're testing that internally. One question: which version of libdbi/libdbi-drivers are you using? Last I've checked they had important bugfixes in their CVS repository (some of which I contributed), but they were not yet released. We're using an internally built libdbi, branching off from their CVS HEAD. These can be found on git.balabit.hu. -- Bazsi
Hmmm Im not using libdbi , I thought freetds is its equivalent. -----Original Message----- From: syslog-ng-bounces@lists.balabit.hu [mailto:syslog-ng-bounces@lists.balabit.hu] On Behalf Of Balazs Scheidler Sent: Tuesday, July 13, 2010 3:29 PM To: Syslog-ng users' and developers' mailing list Subject: Re: [syslog-ng] Syslog-ng 3.0.7 fails to insert into microsoft sql server On Tue, 2010-07-13 at 15:04 +0400, Khaleelah Peerbocus wrote:
The user has all the permissions. That's why I have tried the other way round using Pipe.
But still in vain
I've helped with your other case, but I really think that it should work with mssql as well. We're testing that internally. One question: which version of libdbi/libdbi-drivers are you using? Last I've checked they had important bugfixes in their CVS repository (some of which I contributed), but they were not yet released. We're using an internally built libdbi, branching off from their CVS HEAD. These can be found on git.balabit.hu. -- Bazsi ____________________________________________________________________________ __ 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)
-
Balazs Scheidler
-
Khaleelah Peerbocus