Awstats Log Analysis tool installation and use under Linux

Source: Internet
Author: User

The merge log file can use Bash's sort command:

#sort " " 4 -o log_all access*.log

You can also use the logresolvemerge.pl provided by Awstats

#perl /usr/local/awstats/tools/logresolvemerge.pl-dnslookup= -showsteps access*.log >log_ All
-showsteps indicates that the progress is shown every 8192 lines.
The-dnslookup=100 represents DNS resolution of the Access IP with 100 threads.

The above command merges the logs that need to be analyzed into a single log_all file

#Perl  awstats_configure.pl#perl awstats.pl-config=www.mysite.com-update  - showdropped  -showcorrupted#perl awstats_buildstaticpages.pl-config=www.mysite.com-month=  -year=2016-dir=/root/mysite

Parameters to focus on:
Not viewed traffic * contains data for the UA Crawler, as well as a 404 error message for the answer code.

Awstats is used for statistical analysis, some indicators can not be analyzed, some time we need to check the relevant original log. In these cases, you might consider using the regular expression tool to analyze the log directly.

If it is a log file under Windows that uses regular expression processing under UNIX, you need to replace \ n with the end. You can use the Dos2unix command, but if there is binary data in the log, it will fail. You need to use the SED command.

#sed's/^m$/\n/g' log_all

-I indicates that the modification results are written directly to the file.

-E indicates the use of regular expressions

Awstats Log Analysis tool installation and use under Linux

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.