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中創建對應的索引模式。