安装ELK
elasticsearch下载地址:
https://www.elastic.co/downloads/elasticsearch
logstash下载地址:
https://www.elastic.co/downloads/logstash
kibana下载地址:
https://www.elastic.co/downloads/kibana
安装参考(推荐官网下载压缩包再解压,brew安装会缺少x-pack插件):
https://www.cnblogs.com/liuxiaoming123/p/8081883.html
操作步骤
1. elasticsearch部分
启动elasticsearch,访问http://localhost:9200
sh ./bin/elasticsearch
2.logstsh部分
日志文件格式
log_format wwwlogs '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for $request_time';
27.148.152.0 - - [07/Sep/2017:17:24:53 +0800] "GET /1.php HTTP/1.1" 200 25327 "-