2019年12月17日火曜日

nxlog.conf 受け側でファイルローテート 20分間隔 5つ

cat /etc/nxlog.conf
#cat /etc/nxlog.conf
## This is a sample configuration file. See the nxlog reference manual about the
## configuration options. It should be installed locally under
## /usr/share/doc/nxlog-ce/ and is also available online at
## http://nxlog.org/docs

########################################
# Global directives                    #
########################################
User nxlog
Group ses

LogFile /var/log/nxlog/nxlog.log
LogLevel INFO
#LogLevel DEBUG

########################################
# Modules                              #
########################################

<Extension _fileop>
     Module xm_fileop
</Extension>

########################################
# LISTEN PORT                          #
########################################

<Input in_port>
    Module      im_tcp
    Host        0.0.0.0
    Port        XXXX
</Input>


########################################
# Output File                          #
########################################

<Output fileout>
    Module      om_file
    File        "ディレクトリパス/ファイル名"
        <Schedule>
#               When    @hourly
                When    */20 * * * *
                <Exec>
                        file_cycle(file_name(), 5);
                        reopen();
                </Exec>
        </Schedule>
</Output>


########################################
# Routes                               #
########################################

<Route XXXX>
    Path        in => fileout
</Route>