Article From:https://www.cnblogs.com/xiaoyaoren/p/9970554.html

 

 

 

 

Nxlog 

 

 

 

> handsome

 

 

1nxlog, all defaults can be.

2, MODIFICATION OF CONFIGURATION FILE

Enter Configuration File CatalogC:\Program Files (x86)\nxlog\conf   Modify Configuration Filenxlog.conf ( Modify and save the document as “Song Style”utf-8 format, otherwise the path of importing log files containing Chinese will easily generate scrambling, leading to the failure to forward the log normally.)

 

 

Pathnxlog, if there is any change, please modify it. 

define CERTDIR  %ROOT%\cert

define CONFDIR  %ROOT%\conf

define LOGDIR   %ROOT%\data

define LOGFILE  %LOGDIR%\nxlog.log

LogFile %LOGFILE%

 

Moduledir %ROOT%\modules

CacheDir  %ROOT%\data

Pidfile   %ROOT%\data\nxlog.pid

SpoolDir  %ROOT%\data

 

<Extension _syslog>

    Module      xm_syslog

</Extension>

 

<Extension _charconv>

    Module      xm_charconv

    AutodetectCharsets GB2312,gbk,utf-8,iso8859-2,utf-16, utf-32   # Label means import, oneinputIntroducing One or One Type

Module       im_file             #Represents the import file

File          “D:\SG-UEP_V2.0_\etlProcess*”  # Expresses MatchingetlProcess (Important) Hereuep,\activemq.log”

        Exec             $Message = $raw_event;

        Exec             $SourceName = ‘activemq’;

        SavePos          TRUE

        Recursive         TRUE

    Exec             $tag = “activemq.log”;

</Input>

<Processor filewatcher_transformer>          #This module is not available by default, add it manually. Click here to configure.

    Module          pm_transformer

    Exec             $Message = $raw_event;

Exec             convert_fields(“GB2312″,”utf-8”);

OutputFormat     syslog_bsd

</Processor>

 

<Extension _exec>

    Module      xm_exec

</Extension>

 

<Extension _fileop>

    Module      xm_fileop

 

    # Check the size of our log file hourly, rotate if larger than 5MB

    <Schedule>

        Every   1 hour

        Exec    if (file_exists(‘%LOGFILE%’) and \

                   (file_size(‘%LOGFILE%’) >= 5M)) \

                    file_cycle(‘%LOGFILE%’, 8);

    </Schedule>

 

    # Rotate our log file every week on Sunday at midnight

    <Schedule>

        When    @weekly

        Exec    if file_exists(‘%LOGFILE%’) file_cycle(‘%LOGFILE%’, 8);

    </Schedule>

</Extension>

<Output out_eventlog>                #This module is an output module, which is added manually. Click here to configure.

 Module      om_udp

 Host        20.58.9.132

 Port        514

 Exec              to_syslog_bsd();

</Output>

<Route eventlog>                     #inputProcessoroutput was added manually in this configuration file.inputProcessoroutputrouteinputinputExec          $SourceName = ‘uep’;  tomcattomcatuep3ngxlog4 Log, modify the wrong configuration. The log path is:C:\Program Files (x86)\nxlog\data\nxlog.log, This path is the default path, if installed to other disks, please go to the corresponding folder to view the log.

 

Link of this Article: Nxlog installation configuration

Leave a Reply

Your email address will not be published. Required fields are marked *