ELK日志分析管理
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ELK日志分析管理相关的知识,希望对你有一定的参考价值。
序号
IP 用途 备注
1 172.18.146.163 kibana, logstash
2 172.18.146.160 elasticsearch
Elasticsearch配置部分
172.18.146.160
vi /etc/security/limits.conf
??????? hard??? nofile?????????? 65536
??????? soft??? nofile?????????? 65536
- soft nproc 10240
- hard nproc 10240
添加用户
useradd es
mkdir –p /workspace/app/elasticsearch-6.4.0/
tar xvfz /tmp/ elasticsearch-6.4.0.tar.gz –C /workspace/app/elasticsearch-6.4.0/
path.data: /workspace/data/elasticsearch
path.logs: /workspace/log/elasticsearch
network.host: 0.0.0.0
http.port: 9200
Kibana配置部分
/workspace/app/kibana-6.4.0/config/kibana.yml
server.host: "0.0.0.0"
elasticsearch.url: "http://172.18.146.160:9200"
kibana.index: ".kibana"
启动服务:
nohup kibana &
logstash配置部分
配置文件存放路径:/workspace/app/logstash-6.4.0/config/conf.d/
/workspace/app/logstash-6.4.0/config/conf.d/sync.conf
input {
file {
path => "/workspace/data/webapps/witc-sync-web/witc-sync-web.log"
type => "witc-sync-web01"
start_position => "beginning"
}
}
filter {
multiline {
pattern => "^%{TIMESTAMP_ISO8601:time}s+(?<Level>(S+))."
negate => true
what => "previous"
}
grok {
match => [ "^%{TIMESTAMP_ISO8601:time}s+(?<Level>(S+)).","message" ]
}
}
output {
elasticsearch {
hosts => ["172.18.146.160:9200"]
index => "witc-sync-web01-%{+YYYY.MM.dd}"
}
}
mkdir /workspace/data/logstash/witc-sync-web
启动服务:
nohup logstash -f /workspace/app/logstash-6.4.0/config/conf.d/ sync.conf --path.data=/workspace/data/logstash/witc-sync-web &
停止服务:
杀进程
kibana使用
以上是关于ELK日志分析管理的主要内容,如果未能解决你的问题,请参考以下文章