Forward MS SQL Database logs towards Syslog


#1 manish.mohite

Hello,

I have Windows SQL server 2019 installed on Windows server 2019. i have installed the nxlog community edition on Server to forward the  Database logs generating in following path: C:\Program Files\Microsoft SQL Server\MSSQL15.BAMSM\MSSQL\Log\ERRORLOG

I have written following conf in nxlog but it i have not received any logs in Syslog Server. Kindly help me to resolve the issue if there is any changes to be done in the below mentioned configuration:

<Extension _syslog>   Module          xm_syslog</Extension><Input in>   Module      im_file   File      “C:\\Program Files\\Microsoft SQL Server\\MSSQL15.BAMSM\\MSSQL\\Log\\ERRORLOG”   SavePos      TRUE   Recursive TRUE</Input>

<Output out>   Module      om_udp   Host        192.168.105.10   Port        514   Exec        $Message = "TEST DB LOG " + $raw_event;   Exec        to_syslog_bsd();</Output>

<Route 1>   Path        in => out</Route>

#2 NenadMDeactivated Nxlog ✓

Hello Manish,

There are two things you can do:
Check the internal log file in C:\Program Files\nxlog\data\nxlog.log and find out if nxlog has any problems to read from the file C:\Program Files\Microsoft SQL Server\MSSQL15.BAMSM\MSSQL\Log\ERRORLOG
Those files usually have some extension. In case this path is a directory, please try using a wildcard * as per instruction in the documentation page: https://docs.nxlog.co/ce/current/index.html#im_file

Also, you can add an additional test output and try writing the logs into some local file. It's a simple test to check whether the output module works and if it sends the logs.