Rsyslog+loganalyze+mysql Log Centralized Processing

Source: Internet
Author: User
Tags rsyslog

With the increase of the server, feel the time to look at the log has been more and more, but also a variety of inconvenient, so want to focus on a server to deal with. I forgot it after I was afraid to use it, so I'll make a note.

Because my LNMP environment has been set up very early. So it was used directly.

I also refer to this article to build.

Http://www.cnblogs.com/mchina/p/linux-centos-rsyslog-loganalyzer-mysql-log-server.html

After this article has been built, you may encounter

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/5D/DA/wKioL1Ul5fvyxo9zAACBSJ8ziO4988.jpg "title=" QQ picture 20150409103153.png "alt=" Wkiol1ul5fvyxo9zaacbsj8zio4988.jpg "/>

This is not a log record.

There is no data in systemevents at this time.

View the issue by viewing/var/log/messages. My problem is that MySQL cannot be connected via/var/lib/mysql/mysql.sock.

Because my mysql.sock is placed in/tmp. thus

Ln-s/tmp/mysql.sock/var/lib/mysql/mysql.sock

Restart the next rsyslog to finish. Found no error. Open the Web again, you can also see the log.


Now I want to add some non-syslog. such as Nginx+app+mysql's log.


Rsyslog the central server without the tube, as good as before, the client needs to change under.


#nginx  log$ModLoad imfile   #不加这个会报错. $InputFileName  /usr/local/nginx/logs/error.log  #文件需要真实存在 $InputFileTag  nginx-errorlog:        #读取文件定义下标签, the same host cannot have 2 $inputfilestatefile nginx-errorlog         $InputRunFileMonitor                              #表示开始监控 $ Inputfilename /usr/local/nginx/logs/access.log$inputfiletag nginx-accesslog: $InputFileStateFile  nginx-accesslog$InputRunFileMonitor$InputFilePollInterval 10                   #等待10秒钟发送一次if   $programname  ==   ' Nginx-errorlog '  then @192.168.0.12:514  #匹配就远程传输数据到192 .168.0.12if  $programname   ==  ' Nginx-errorlog '  then ~if  $programname  ==  ' nginx-accesSlog '  then @192.168.0.12:514if  $programname  ==  ' Nginx-accesslog '  then ~ 



The same format as other documents. MySQL or app logs.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/5D/DA/wKioL1Ul7UHQJS_EAAGpwVP62Fk302.jpg "title=" QQ picture 20150409110300.png "alt=" Wkiol1ul7uhqjs_eaagpwvp62fk302.jpg "/>

This is the other log I added. If the log file does not have data, it will not be displayed.

This loganalyer shows that the nginx effect does not feel very good.


This article is from the "on the Road to Learning" blog, be sure to keep this source http://jonyisme.blog.51cto.com/3690784/1630338

Rsyslog+loganalyze+mysql Log Centralized Processing

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.