Filebeat与Kibana集成展示日志数据的步骤如下:
filebeat.yml,指定要监控的日志路径和输出目标(Elasticsearch)。filebeat.inputs:
- type: log
enabled: true
paths: ["/var/log/*.log"] # 替换为实际日志路径
output.elasticsearch:
hosts: ["localhost:9200"] # 替换为Elasticsearch地址
kibana.yml,指定连接Elasticsearch的地址。elasticsearch.hosts: ["http://localhost:9200"]
http://<kibana_host>:5601),进入“Management→Index Patterns”,创建与Filebeat日志匹配的索引模式(如filebeat-*),选择时间字段(通常为@timestamp)。说明:若需通过Logstash处理数据,需在Filebeat中配置output.logstash,并在Kibana中创建对应的索引模式。