Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Use the below-mentioned NXLog config to create NXLog config for MySQL

...

  1. Login on Windows MySQL Server

  2. Download the latest version of nxlog. It is easiest to choose the Windows msi file which includes an installer: 

 http://nxlog.org/products/nxlog-community-edition/download

3. Open the Nxlog configuration file at:

        C:\Program Files (x86)\nxlog\conf\nxlog.conf

4.Use below mentioned nxlog config to configure windows MySQL log from MySQL server(replace nxlog.conf whole file content from below config ):

Code Block
##################################################

## This is a sample configuration file. See the nxlog reference manual about the
## configuration options. It should be installed locally and is also available
## online at http://nxlog.org/nxlog-docs/en/nxlog-reference-manual.html

## Please set the ROOT to the folder your nxlog was installed into,
## otherwise it will not start.

#define ROOT C:\Program Files\nxlog
define ROOT C:\Program Files (x86)\nxlog

Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
SpoolDir %ROOT%\data
LogFile %ROOT%\data\nxlog.log


<Extension syslog>
  Module xm_syslog
</Extension>

<Input dbi>
    
    Module  im_dbi
    Driver  mysql
    Option  host 127.0.0.1
    Option  username mysql
    Option  password mysql
    Option  dbname logdb
    SQL     SELECT id, facility, severity, hostname, \
                   timestamp, application, message \
            FROM log
    Module im_file
    File "C:\\Windows\\MySQL.log"
    SavePos TRUE
    InputType LineBased    
</Input>

<Output dbi_out>
file>  Module om_udp
 Module Host om_file
CCE_IP_ADDRESS
  Port 514
  Exec File$SyslogFacilityValue = 2;
 "tmp/output"
</Output>

<Route dbi_to_file>
    Path     Exec $SourceName = 'mysql_logs';
  Exec to_syslog_bsd();
</Output>

<Route dbi>
  Path dbi => filedbi_out
</Route>

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@1422e
showSpacefalse
sortmodified
typepage
reversetrue
labelsMySQL
cqllabel = "mysql" and type = "page" and space = "SUP"
Page Properties
hiddentrue

Related issues