By default, the log log format is:Logformat "%h%l%u%t \"%r\ "%>s%b \"%{referer}i\ "\"%{user-agent}i\ "" combinedwhere%h is the IP of the record visitor, if there is a layer of proxy in the front of the web, then this%h is actually the IP of the proxy machine, this is not what we want. In this case,the%{x-forwarded-for}i field records the client's real IP. So log
By default, the log log format is:Logformat "%h%l%u%t \"%r\ "%>s%b \"%{referer}i\ "\"%{user-agent}i\ "" combinedWhere%h is the IP of the record visitor, if there is a layer of proxy in the front of the web, then this%h is actually the IP of the proxy machine, this is not what we want. In this case,The%{x-forwarded-for}i field records the client's true IP. So log
Components used to query IP addresses
Copy Code code as follows:
wget http://rfyiamcool.googlecode.com/files/nali-0.1.tar.gz
Tar zxvf nali-0.1.tar.gz
CD nali-0.1
./configure make make install
The steps and Nginx are similar, just take the log inside the method of IP address is not the same ~ ~ ~
Copy Code code as follows:
#!/bin/bash
#rfyiamcool
Ipsumfile=access_ip.log
Savefile=ipaddress.txt
ECHO-
1. According to the Apache log, get the maximum number of concurrent records in the second day
tail-10000./demo.fdipzone.com_access_log.2014-01-16_01 | Cut-d "["-F 2 | awk ' {print $} ' | Sort | uniq-c | Sort-nr | Head
tail-10000./demo.fdipzone.com_access_log.2014-01-16_01 | Awk-f "[" ' {print $;} ' | awk ' {print $} ' | Sort | uniq-c | Sort-nr | Head
Run Result:
fdipzone@ubuntu:~$ tail-100000./demo.fd
Article title: connectionresetbypeer appears in the apache error log. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
This problem usually occurs when the client cancels the connection before the connection is fully established. for example, if the user presses the "sto
In the log see more like the following error:
[Sun 25 10:35:03 2013] [10970692] [Userlimit:warn] [client 119.147.225.xxx:58664] Vhost limit:access to/xxx/xxx/xxx.gif deferred, requested Ho St xxx.com, Username 10970692 Userlimit (exceeded currently), Referer http://xxx.com/index.php
I don't know what the limit is,
There will be a few consecutive times,
There will be twenty or thirty of these records in a row,
The continuous record IP is the sam
Some logs, such as Apache, do not support JSON with Grok plugins like NginxGrok using regular expressions for row-matching splitsThe predefined locations are defined in the/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-patterns-core-2.0.5/patternsApache in File Grok-patternsView official documentsHttps://www.elastic.co/guide/en/logstash/current/plugins-filters-grok.htmlVim/etc/logstash/conf.d/grok.confinput{ Stdin{}}filter { Grok { match +
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
One, analysis Apache log
1, there is a document SHELL.SH, the contents are as follows:
[Root@test3root] #catshell. sh
Http://www.baidu.com/index.html
Http://www.google.com/index.html
Http://www.baidu.com/get.html
Http://www.baidu.com/set.html
Http://www.google.com/index.html
Http://www.yahoo.com.cn/put.html
It is now required to intercept the domain name in the file, to count the number of occurren
Suppose the Apache log format is:
118.78.199.98–-[09/jan/2010:00:59:59 +0800] "Get/public/css/index.css http/1.1″304–" http://www.a.cn/common/ index.php "
" mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; GTB6.3) "
Issue 1: Find the most visited 10 IP in Apachelog.
awk ' {print $} ' apache_log |sort |uniq-c|sort-nr|head-n 10awk first grabs the IP from each
/home/wwwroot/logs This is the log storage path when you add these to the configuration file, restart Apache650) this.width=650; "style=" float:right;width:700px;height:101px; "src=" http://s3.51cto.com/wyfs02/M00/58/6B/ Wkiol1svjcmchvlyaaemm5ip0ka945.jpg "title="}lwkuxsr~{$VY ' 7%oq@qi{g.png "border=" 0 "height=" 101 "hspace=" 0 "vspace=" 0 "width=" alt= "Wkiol1svjcmchvlyaaemm5ip0ka945.jpg"/>Linux Apache c
Abstract Log4cxx is one of the subprojects of the Open source project Apache Logging Service, which is used to provide log functionality for C + + programs so that developers can debug and audit the target program. This paper introduces the usage and configuration of log4cxx, and gives an example which can be started quickly. Finally, some practical suggestions are given for the
/profileFile (required if first install) [y/n]? Y whether to create a new awstats configuration file----------------------------------3-----------------------------------Your Web site, virtual server or profile name:
www.benet.com//Enter domain name
--------------4--------------The default path should not enter .... EnterHttp://www.abc.com/awstats/awstats.pl?config=www.abc.com tells you that you can access it through this website.====================================================
Apache cannot be started. there is no error prompt. the error log is as follows. [Fri May 31 20:33:04 2013] [notice] suEXEC mechanic enabled (wrapper:/usr/sbin/suexec)
[Fri May 31 20:38:02 2013] [notice] suEXEC mechanic enabled (wrapper:/usr/sbin/suexec)
[Fri May 31 20:41:58 2013] [notice] suEXEC mechanic enabled (wrapper:/usr/sbin/suexec)
[Fri May 31 20:50:02 2013] [notice] suEXEC mechanic enabled (wrapper
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.