storage server# The default value is 23000storage_server_port=23000# The group name of the local storage serverGroup_name=group1 #当前storage机器组名# if the Url/uri including the group name# set to False when Uri Like/m00/00/00/xxx# set to True when URIs like ${group_name}/m00/00/00/xxx, such as Group1/m00/xxx# default value is FalseUrl_have_group_name = True# path (disk or mount point) count, default value is 1# must same as storage.confStore_path_count=1# store_path#, based 0, if Store_path0 not e
is due to see the group within the great God @ Shenzhou browser statistics, I also want to practice, so today not out of the day (of course, still have to eat) ~train of ThoughtThe first is to write an automatic timing task, run the script at 23:55 every night, script do log cutting and turn into the required data JSONMake the access interface to get the parsed JSON data, such as browser model, System model
Description
Favicon.ico occupy Nginx error_log log a lot of information, we really need to view the log to cover. So here we turn it off by log_not_found off.
Realize:
Put the following configuration into the server {} block, log
the log, the directory is:/usr/share/nginx/logs/test.access.log
Set Nginx log Format
To set the log format in nginx.conf: Logstash
Log_format '$http _host$server _addr$remote _addr [$time _local] "$request" ' '$request _body$status$body _bytes_sent "$http _referer"
about Nginx Log timing cutting, there are two general scenarios, the first with logrotate, it is a Linux system log management tool, it can cut, press Logrotate is based on the crontab operation, so this time point is controlled by crontab, can be queried crontab configuration file/etc/anacrontab. The second is a timed cut with shell scripts. First Scenario: Log
})? | -) \ "%{host:domain}%{number:response} (?:%{number:bytes}|-)%{qs:referrer}%{qs:useragent}" (%{ip:x_forwarder_for}| -)"
Because it is the test environment, I use Logstash to read the Nginx log file to get the Nginx log, and only read the Nginx
Nginx log segmentation Abstract: nginx does not support log segmentation, but its PID can be used to achieve log segmentation. I have read several online examples, but they are not clear. So I decided to write one by myself. Maybe I forgot one day and can start learning agai
Description
Operating system: CentOS
Site 1:bbs.jb51.net
Site 2:sns.jb51.net
Nginx Installation path:/usr/local/nginx
Nginx configuration file path:/usr/local/nginx/conf/nginx.conf
Site 1 configuration file path:/usr/local/nginx/conf/vhost/bbs.jb51.net.conf
Site 2 con
There are two articles in front of elk about MySQL slow log collection and Nginx access log collection, so how can the logs of different types of applications be easily collected? And see how we deal with this problem efficiently.
Log specification
The specification of th
The preface introduces the access log and error log under Apache server. View and simple analysis then this article describes the two kinds of log views on the Nginx server.
Find Log Store Address
Find/-name nginx.conf
Accordin
among the files of the specified directory.This module is not a included in the default Nginx build.Syntax: on or offLogThis module controls the behavior of Nginx regarding access logs. It is a key module for system administrators as it allows analyzing the runtime behavior of the Web applications. It is composed of three essential directives:
Access_logC
This article mainly records the Nginx log statistics process given to Python, the main reason is the recent system is often unknown program crazy crawl data, although did a anti-crawling mechanism, but still have to find out which IP access times more. The idea is to find these IP rankings by analyzing the ngxin logs. The procedures for specific scenarios include
number of dump times before the log file is deleted. 0 indicates no backup, and 5 indicates five backups are retained.Tabootext [+] list to prevent logrotate from dumping files with the specified extension. The default extension is. rpm-orig,. Rpmsave, v, and ~Size: dump a log file only when it reaches the specified Size. size can specify bytes (default), KB (sizek), or MB.(Sizem ).RedHat Linux)-----------
Nginx is awesome, but it ' s missing some common features. For instance, a common thing-to-add to access logs are a unique ID per request, so it can track the flow of a single Request through multiple services. Another thing it's missing is the ability to log request_time in milliseconds, rather than seconds with a millisecond gran Ularity. Using Lua, we can add
example One, by date cutting Nginx log, and automatically delete 7 days ago log (log has been synchronized to the dedicated log storage server, you can safely delete the history log.) )
#!/bin/bash#初始化Logs_path=/data/
Accidentally found that the Access.log is 21G large, so cut it.Nginx is a very lightweight Web server, small size, high performance, fast, and many other advantages. But shortcomings are also shortcomings, such as the resulting access log file has been one, will not be automatically cut, if the traffic is very large, will result in a very large log file size, not
Author: zhanhailiang date: by default, nginx will generate only one accesslog and one errorlog, and the log file will become very large as it accumulates every day. if you need to analyze the log, whether using script analysis or downloading logs for local analysis,
Author: zhanhailiang date:
By default, nginx generate
the awstats.sh
The code is as follows
Copy Code
./awstats.sh
If you see it generate a bunch of web pages, that means success.
6. Modify Nginx Configuration
The code is as follows
Copy Code
server {Listen 80;server_name www.111cn.net;Access_log/var/log/www/access.log main;Root/var/www/vhosts/www.111cn.net;Index index.php index.html index.h
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.