Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to do Apache log Shell analysis

Shulou Source: shulou.com Published: 2022-06-01 03:43:33 09月27日 Update

In this issue, the editor will bring you about how to conduct Apache log Shell analysis. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

1. Check the number of IP visits on the day:

Awk'{print $1} 'log_file | sort | uniq | wc-l

2. View the number of times a page has been visited:

Grep "/ index.php" log_file | wc-l

3. Check the number of pages visited by each IP:

Awk'{+ + S [$1]} END {for (an in S) print S [a]} 'log_file

4. Sort the number of pages visited by each IP from small to large:

Awk'{+ + S [$1]} END {for (an in S) print S [a], a} 'log_file | sort-n

5. Check which pages have been visited by an IP:

Grep ^ 111.111.111.111 log_file | awk'{print $1J 7}'

6. Remove the page for the day of search engine statistics:

Awk'{print $12 recording 1} 'log_file | grep ^\ "Mozilla | awk' {print $2}'| sort | uniq | wc-l

7. See how many IP visits were made during the 14:00 hour on June 21, 2009:

Awk'{print $4 print 1} 'log_file | grep 21/Jun/2009:14 | awk' {print $2}'| sort | uniq | wc-l

The above is the editor for you to share how to carry out Apache log Shell analysis, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Tags: Pages analysis logs content from small to large professional small and medium-sized from childhood rich in content small that is engines search engines articles more times knowledge articles industries perspectives Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info vpn Redmi MariaDB MySQL