The syslog-ng OSE application does not rotate logs by itself. To use syslog-ng OSE for log rotation, consider the following approaches:
Ideal for workstations or when processing fewer logs.
It is included in most distributions by default.
Less scripting is required, only logrotate has to be configured correctly.
Requires frequent restart (syslog-ng OSE must be reloaded/restarted when the files are rotated). After rotating the log files, reload syslog-ng OSE using the syslog-ng-ctl reload command, or use another method to send a SIGHUP to syslog-ng OSE.
The statistics collected by syslog-ng OSE, and the correlation information gathered with Pattern Database is lost with each restart.
Ideal for central log servers, where regular restart of syslog-ng OSE is unfavorable.
Requires shell scripts or cron jobs to remove old logs.
It can be done by using macros in the destination name (in the filename, directory name, or the database table name). (For details on using macros, see Templates and macros.)
This sample file destination configuration stores incoming logs in files that are named based on the current year, month and day, and places these files in directories that are named based on the hostname:
destination d_sorted { file( "/var/log/remote/${HOST}/${YEAR}_${MONTH}_${DAY}.log" create-dirs(yes) ); };
This sample logstore destination configuration stores incoming logs in logstores that are named based on the current year, month and day, and places these logstores in directories that are named based on the hostname:
destination d_logstore { logstore( "/var/log/remote/${HOST}/${YEAR}_${MONTH}_${DAY}.lgs" compress(9) create-dirs(yes) ); };
This sample command for cron removes files older than two weeks from the /var/log/remote directory:
find /var/log/remote/ -daystart -mtime +14 -type f -exec rm {} \;
This chapter collects the manual pages of syslog-ng OSE and other related applications that are usually distributed and packaged together with the syslog-ng Open Source Edition application.
This chapter collects the manual pages of syslog-ng OSE and other related applications that are usually distributed and packaged together with the syslog-ng Open Source Edition application.
Table of Contents
dqtool — Display the contents of a disk-buffer file created with syslog-ng Open Source Edition
dqtool
[command] [options]
NOTE: The dqtool application is distributed with the syslog-ng Open Source Edition system logging application, and is usually part of the syslog-ng package. The latest version of the syslog-ng application is available at the syslog-ng page.
This manual page is only an abstract, for the complete documentation of syslog-ng, see the syslog-ng Documentation page.
The dqtool application is a utility that can be used to display and format the messages stored in a disk-buffer file.
cat
[options] [file]
Use the cat command to display the log messages stored in the disk-buffer (also called disk-queue) file, and also information from the header of the disk queue file. The messages are printed to the standard output (stdout), so it is possible to use grep and other tools to find particular log messages, e.g., dqtool cat /var/log/messages.lgs |grep 192.168.1.1.
The cat command has the following options:
Print diagnostic and debugging messages to stderr.
Display a brief help message.
Format the messages using the specified template.
Print verbose messages to stderr.
Display version information.
Example:
./dqtool cat ../var/syslog-ng-00000.qf
The output looks like:
Disk-buffer state loaded; filename='../var/syslog-ng-00000.qf', qout_length='65', qbacklog_length='0', qoverflow_length='9205', qdisk_length='0' Mar 3 10:52:05 tristram localprg[1234]: seq: 0000011630, runid: 1267609923, stamp: 2010-03-03T10:52:05 PADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADD Mar 3 10:52:05 tristram localprg[1234]: seq: 0000011631, runid: 1267609923, stamp: 2010-03-03T10:52:05 PADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADD
For the detailed documentation of syslog-ng OSE see the syslog-ng Documentation page
If you experience any problems or need help with syslog-ng, visit the syslog-ng mailing list.
For news and notifications about of syslog-ng, visit the syslog-ng blogs.
© 2024 One Identity LLC. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center