1.filebeat配置文件 filebeat-dataexchange.yml
filebeat.inputs:
- type: log
enabled: true
paths:
- E:\IdeaWorkspace\data-exchange\log\*.log
output.logstash:
# The Logstash hosts
hosts: ["localhost:5044"]
#调试用
output.console:
pretty: true
2.logstash配置文件 first-test.yml
input {
beats {
port => "5044"
}
}
filter {
}
output {
# stdout { codec => rubydebug } #测试用
elasticsearch { hosts => "localhost:9200" }
}
3.启动logstash和filebeat
logstash.bat -f ../config/first-test.yml
启动filebeat
filebeat -c filebeat-dataexchange.yml
4.部署elasticsearch,并启动
5.部署kibana ,修改配置文件,并启动
6.再kibana中 测试
GET /logstash-2022.08.23-000001/_search
{
"query": {
"match_all": {}
}
}