我使用以下配置启动了logstash:
在logstash.yml里面:
queue.type: persisted
queue.max_bytes: 8gb
queue.checkpoint.writes: 1
配置文件:
input {
beats {
port => "5043"
}
}
filter {
grok {
match => {
"message" => "%{COMBINEDAPACHELOG}"
}
}
geoip {
source => "clientip"
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "test"
document_type => "tw"
}
}
我有这样的情况。
现在,如果我打开logstash和elasticsearch,logstash不会发送在步骤2中收到的消息 - 即弹性搜索关闭并且logstash正在接收事件。
现在Logstash Persistent Queues的行为如下: “当启用持久队列功能时,Logstash会将事件存储在磁盘上.Logstash以一种称为检查点的机制提交到磁盘。”
https://www.elastic.co/guide/en/logstash/current/persistent-queues.html https://www.elastic.co/guide/en/logstash/current/persistent-queues.html#durability-persistent-queues