Rsyslog + mysql + loganalyzer build a log server The general idea is as follows: Use the rsyslog service that comes with Linux as the underlying layer, and then use the templates of mysql and rsyslog to store files and display them on the web.
[Root @ localhost ~] # Grep-v '^ #'/etc/rsyslog. conf | grep-v '^ $' $ ModLoad ommysql *. *: ommysql: localhost, Syslog, rsyslog, 123456 $ ModLoad imuxsock # provides support for local system logging (e.g. via logger command) $ ModLoad imklog # provides k
RsyslogThe service for logging in Linux systems, called Rsyslog, is an enhanced version of the early Syslog service, which is automatically installed and started by default.1. Start the service[[Email protected] log]# service Rsyslog start2. Configuration files[Email protected] log]# more/etc/rsyslog.confBasic format:Facility.prioritylog_location[Email protected] log]# more/etc/rsyslog.conf |grep-v ^# |grep-v ^$$ModLoad imuxsock.so# provides support for local system logging (e.g. via Logger comm
: password2: username2: unit2: 20User3: password3: username3: unit3: 30
Now let's create an awk script, which was previously performed on the command line. In fact, all operations can be implemented on the command line, and we have begun to use the most frequently used batch add users!
Script1.awk
#! /Bin/awk-F # When the file has executable permissions, you can directly execute#./Script1.awk example2.txt# If this line does not exist, an error may occur, or# Awk-F script1.awk example2.txt parame
information in/var/log/securemail. *-/var/log/maillog ##### store all mail Information in/var/log/maillog. Here there is a-symbol, indicating that it is recorded in asynchronous mode, because the log is usually large cr On. */var/log/cron #### information about scheduled tasks is stored in/var/log/cron *. emerg * (* indicates all users) ### record all information greater than or equal to the emerg level, and send it to every user logged on to the sys
Rsyslog By default can only transfer the system log, such as Dhcp,cron, now to send a service log to the remote Rsyslog server, how to do it?Workaround: To use the Rsyslog imfile module.Reference official url:http://www.rsyslog.com/doc/v8-stable/configuration/modules/imfile.htmlReference online URL:HTTP://WWW.TUICOOL.COM/ARTICLES/JV2EUVNRsyslog configuration file (the content of the comment is filtered out):[Email protected] ~]# cat/etc/rsyslog.conf | Egrep-v "#|^$"$ActionFileDefaultTemplate Rsy
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.