How to Use syslog-ng to collect logs from a remote Linux machine
If your data centers are all Linux servers, you are the system administrator. One of your tasks is to view the server's log files. However, if you view log files on a large number of machines, You need to log in to the machine one by one to read the log files. If you manage a large number of machine
A recent Sendcloud project requires the use of the Syslog-ng collection log.
The principle is multiple production machine deployment of different modules, including Nodejs, Java and so on, each production machine according to a certain rules to generate a log.
Generally our production machine redhat default SYSLOGD logging, you can use SYSLOGD to send logs throug
Syslog-ng is installed to manage server logs in a unified manner. The installation method is found online. Some problems need to be solved now;
1. The log server can synchronize the log files on a daily basis, but the log files you want cannot be synchronized to the server because you need to customize the log files. Now, I have posted the configuration documents and hope to learn from them.
Install
);
Owner (root );
Group (root );
Perm (0640 );
Dir_perm (0750 );
};
Source src
{
# Message generated by Syslog-NG
# Internal ();
# Standard Linux log source (this is the default place for the syslog ()
# Function to send logs)
# Unix-stream ("/dev/log ");
# Messages from the kernel
# Pipe ("/proc/kmsg ");
# Remote po
: Destination d_udp {UDP ("loghost" port (514 ));}; log {source (SRC); destination (d_udp) ;}; restart the syslog-ng service #/etc/init. d/syslog-ng restart winodws server configuration because Windows server does not support log server, you need to install a conversion software: L
space limit (use as much as possible)
#$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
#$ActionQueueType LinkedList # run asynchronously
#$ActionResumeRetryCount -1 # infinite retries if host is down
# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
#*.* @@remote-host:514
# ### end of the forwarding rule ###
#日志 If non-local storage, you need to specify the
The Syslog module is a module that works in a UNIX environment and is not available for Windows, and can be used with the logging module in a Windows environment. First, syslogThe Syslog module can be used to record information about the operation of the system, which is provided by a syslog (Priority,message), which f
First, compile bash to implement the syslog logging function of Bash 1. This paper will realize the function of history record to syslog log through bash software, and it can be transferred to the remote log centralized server in real-time, which can realize the audit function of operation logs.Operating system version
Syslog is the System log in Unix system, so syslogd is a very important service, usually the system troubleshooting and some important events are written in the log, but in the actual production environment often the server is not only one or several, and in the large batch of server log analysis, If it is a station to look at the log will be very time-consuming and laborious, then in the normal production environment can use one or more servers for o
first, to understand the meaning of the Rsyslog configuration file
Configuration file Path/etc/rsyslog.conf
In Rsyslog facility facilities can be used to classify logs from functions or programs in the following ways
Auth
and certification-related
Authpriv
Related to the certification authority
Cron
Specifically for the periodic task schedule to be logged
Daemon
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.