在原有的ELK基础:
安装nginx服务
yum -y install epel-release
yum -y install nginx
开启nginx服务
systemctl enable nginx
systemctl start nginx
验证
[root@bogon conf.d]# netstat -lptnu|grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 73887/nginx: master
tcp6 0 0 :::80 :::* LISTEN 73887/nginx: master
安装ab压测工具,生成测试数据
yum -y install httpd-tools
ab -n 1000 -c 1000 http://192.168.191.131/index.html
-n:请求数
-c:并发数
注意:并发数不能大于请求数!!
编辑nginx.conf
[root@bogon conf.d]# vim nginx.conf
input {
file {
path => "/var/log/nginx/access.log"
type => "nginx-log"
start_position => "beginning"
}
}
filter {
grok {
match => {"message" => "%{NGX}"}
}
}
output{