参考文档 https://www.aliang.org/Linux/nginx-count-access-log.html
### 1.获取指定日期的日志内容
```
cat access.log | egrep "26/Jun/2018"
```
### 2.获取指定时间段的日志内容
```
方式一:
cat access.log | egrep "26/Jun/2018" | sed -n '/00:31:22/,/08:01:28/p'
方式二:
cat access.log | sed -n '/26\/Jun\/2018:00:31:22/, /26\/Jun\/2018:08:01:28/p'
方式三:
sed -n '/26\/Jun\/2018:00:31:22/, /26\/Jun\/2018:08:01:28/p' access.log
注意:sed使用的时间,需要在日志中实际存在的,否则获取不到日志
```
### 3. 获取指定时间段访问量最高的前十位IP
```
sed -n '/26\/Jun\/2018:00:31:22/, /26\/Jun\/2018:08:01:28/p' access.log | awk '{print $1}' | sort | uniq -c | sort -nr -k1 | head -n 10
注意:awk后边不能写日志文件路径
```