Apache Tomcat Log Analysis

Source: Internet
Author: User

Recently looking for information in this regard:

1, view the Apache process:
PS aux | grep httpd | Grep-v grep | Wc-l

2, view TCP connections for port 80:
Netstat-tan | grep "established" | grep ": 80″| Wc-l

3, through the log to view the number of IP connections, filter repeat:

Cat Access_log | grep "24/jul/2007″| awk ' {print $} ' | Sort | uniq-c | Sort-nr

4, the IP connection of the day the highest IP is doing something (the original spider):
Cat Access_log | grep "24/jul/2007:00″| grep "61.135.166.230″| awk ' {print $} ' | Sort | uniq-c | Sort-nr | Head-n 10

5, the same day access page row Top 10 URL:

Cat Access_log | grep "24/jul/2007:00″| awk ' {print $} ' | Sort | uniq-c | Sort-nr | Head-n 10

6, with tcpdump Sniff 80-port access to see who's the tallest
Tcpdump-i ETH0-TNN DST Port 80-c 1000 | Awk-f "." ' {print $1″. ' $2″. " $3″. " $} ' | Sort | uniq-c | Sort-nr
Then from the log to see what the IP is doing:
Cat Access_log | grep 220.181.38.183| awk ' {print $1″\t ' $} ' | Sort | uniq-c | Sort-nr | Less
7, view the number of IP connections for a time period:
grep "2006:0[7-8]" Www20060723.log | awk ' {print $} ' | Sort | uniq-c| Sort-nr | Wc-l

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.