syslog-ng ignores the database defined in syslog-ng.conf and instead uses the default database of the user when logging to MSSQL destination.
destination d_mssql {
sql(type(mssql)
host("myhost") username("myuser") password("mypass")
database("syslogng")
table("msgs_${R_YEAR}${R_MONTH}${R_DAY}")columns(
"seqnum bigint",
"datetime varchar(16)", "host varchar(32)",
"program varchar(32)", "pid varchar(8)", "priority varchar(10)", "facility varchar(10)", "pri int",
"message varchar(max)")
values("$SEQNUM", "$R_DATE", "$HOST", "$PROGRAM", "$PID", "$PRIORITY", "$FACILITY", "$PRI", "$MSGONLY")
indexes("datetime", "host", "program", "pid"));
};
As you can see I want to use "syslogng" as my database but what happens is that syslog-ng uses the default database ("master") configured for "myuser" in MS SQL Server.
If I change the default database for "myuser" in SQL server to "syslogng", then it will write to "syslogng" database. But this is not what I want. I want to be able to configure the database in syslog-ng.conf.
Any ideas why this is happening?
Same question on BalaBit community website.