https://www.elastic.co/cn/downloads/elasticsearch
# ======================== Elasticsearch Configuration ========================= # Use a descriptive name for the node: # node.name: node-1 # network.host: 127.0.0.1 http.port: 9200 http.cors.enabled: true http.cors.allow-origin: "*" cluster.initial_master_nodes: ["node-1"] node.max_local_storage_nodes: 13、配置Kibana
server.port: 5601 server.host: "0.0.0.0" # elasticsearch.url: "http://localhost:9200" elasticsearch.hosts: [ "http://127.0.0.1:9200" ] kibana.index: ".kibana"4、配置Logstash
注意修改path为你的日志文件,可以使用*通配符
config/logstash.conf
input {
file {
path => "/Users/cxl/code/triman-do/elk/logs/*.log"
start_position => beginning
}
# beats {
# port => 5044
# }
}
output {
elasticsearch {
hosts => ["127.0.0.1:9200"]
index => "access-%{+YYYY.MM.dd}"
}
stdout {
codec => json_lines
}
}
first-pipeline.conf
input {
beats {
port => "5044"
}
}
output {
stdout { codec => rubydebug }
}
5、启动命令
5.1 elasticsearch
bin目录下
./elasticsearch5.2 kibana
bin目录下
./kibana5.3 logstash
bin目录下
./logstash -f ../first-pipeline.conf
访问localhost:5601即可



