From b345ef2ee5fb9f6176570d83ded8d8f46ca004df Mon Sep 17 00:00:00 2001 From: jayjiahua <553544693@qq.com> Date: Thu, 15 Jun 2023 20:29:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20redis=20=E6=85=A2=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=96=87=E4=BB=B6=E6=9B=B4=E6=96=B0=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- filebeat/input/redis/harvester.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/filebeat/input/redis/harvester.go b/filebeat/input/redis/harvester.go index 27c53157ed2..043d04c2c1d 100644 --- a/filebeat/input/redis/harvester.go +++ b/filebeat/input/redis/harvester.go @@ -30,6 +30,7 @@ import ( "github.com/elastic/beats/libbeat/logp" "github.com/elastic/beats/filebeat/harvester" + "github.com/elastic/beats/filebeat/input/file" "github.com/elastic/beats/filebeat/util" ) @@ -162,6 +163,12 @@ func (h *Harvester) Run() error { }, } + // 设置为完成状态,避免进度文件回写报错 + data.SetState(file.State{ + Type: "redis", + Finished: true, + }) + h.forwarder.Send(data) } return nil @@ -176,3 +183,4 @@ func (h *Harvester) Stop() { func (h *Harvester) ID() uuid.UUID { return h.id } +