使用持久队列的Logstash

问题描述 投票:7回答:1

我使用以下配置启动了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"
    }
}

我有这样的情况。

  1. 想象一下,弹性搜索被关闭了
  2. 现在想象一下,当关闭elasticsearch时,logstash会收到日志记录事件
  3. 现在想象我们也关闭了logstash

现在,如果我打开logstash和elasticsearch,logstash不会发送在步骤2中收到的消息 - 即弹性搜索关闭并且logstash正在接收事件。

elasticsearch logstash logstash-configuration filebeat
1个回答
0
投票

现在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

© www.soinside.com 2019 - 2024. All rights reserved.