安装 filebeat:
rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
vim /etc/yum.repos.d/elk.repo
[elastic-6.x]
name=Elastic repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
yum -y install filebeat
cd /etc/filebeat/
cp ./filebeat.yml ./filebeat.yml.bak
vim ./filebeat.yml
#input设置
filebeat.inputs:
- type: log
enabled: true
paths:
- /project/www/vautestcom/logs/backup/VAU_Nontrader_error_sys*.log
#multiline.pattern: ^d{4}-d{2}-d{2}
#multiline.negate: true
#multiline.match: after
output设置
setup.template.name: "service"
setup.template.pattern: "service-*"
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["127.0.0.1:9200"]
index: "service-111"
service filebeat restart
安装ES:
yum -y install elasticsearch
service elasticsearch start
查看索引:
curl 127.0.0.1:9200/_cat/indices
安装kibana
yum install -y kibana
#修改配置文件
server.port
server.host
es.url