Linux System Web log Analysis script

Source: Internet
Author: User

Linux System Web log analysis this aspectMore tools, such as Logwatch or awstats, are developed using Perl and are very powerful. But these software need to do someConfiguration, many friends often do not invest too much power in technology, even if reference to the Internet textThe tutorial also does not do. In this case I wrote a Web log analysis script, the function is relatively simple, no configuration, the need for friends can try again.

Script Address:
GBK version (General SSH client does not have to be adjusted directly available:
wget http://jinxiang.oss-cn-hangzhou.aliyuncs.com/weblogcheckgbk.sh
Version UTF8 (if you use this in garbled characters):
wget http://jinxiang.oss-cn-hangzhou.aliyuncs.com/weblogcheckutf8.sh

How to use the script:
./weblogcheckgbk.sh [-c n] [-t n]-F FILE

Option Description:
-C (optional): Set the IP, resource top table display, the default display of the top 5, the parameters need to fill in the whole number
-T (optional): Set the log statistics period, the default statistics last 6 times, the parameters need to fill in the integer
-F (Required): Specifies the log file, if the script is not in the same directory as the log file, the absolute path must be filled
Cases:
./weblogcheckgbk.sh-f/alidata/log/httpd/access/phpwind.log
./weblogcheckgbk.sh-c 3-t 3-f/alidata/log/httpd/access/phpwind.log
Note:
The script can be counted Apache or Nginx log, but need to be common format, currently we provide the user's one-click installation package and Yum mode installation, the log is this format, other custom log format may not run properly.

Operation demo, with Nginx access log as an example:
1, download the script, increase permissions, query the Web Access log location





2. Execute Script Analysis Log
 

Linux System Web log Analysis script

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.