indows下搭建Logstash+Elasticsearch+Kibana日志分析系统
1.请注意 文件路径一定是反斜杠
2.注意 hosts => ["127.0.0.1:9200" 是127.0.0.1,访问路径也必须是127.0.0.1,如果是localhost,则访问路径也是localhost
在bin目录下新建logstash.conf,
input {
file{
path => "D:/logs/common-error.log"
start_position => beginning
}
}
filter {
}
output {
elasticsearch { hosts => ["127.0.0.1:9200"]
index => "timor"
document_type =>"timor"
}
stdout { codec => rubydebug }
}
方法步骤:
1.所有版本
2.所有修改的文件
A:elasticsearch.yml 在末尾加: 访问地址 http://127.0.0.1:9200/
path.data: E:/elk/data
path.logs: E:/elk/logs
B:在logstash的bin目录下新建 logstash.conf,然后输入一下内容,并运行 logstash -f logstash.conf
input {
file{
path => "D:/logs/log4j_file.log"
start_position => beginning
}
}
filter {
}
output {
elasticsearch { hosts => ["127.0.0.1:9200"]
index => "timor"
document_type =>"timor"
}
stdout { codec => rubydebug }
}
C:Kibana.yml,在末尾添加 elasticsearch.hosts: ["http://127.0.0.1:9200"] 访问地址 http://127.0.0.1:5601/app/kibana
3.找到对应index