From 0468cdfa56e625377039fe9b496c892f58df60e7 Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Wed, 11 May 2022 15:03:32 +0100 Subject: [PATCH] Fix convert time ip parsing in jsonv5 --- common/protofilter/filter.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/protofilter/filter.go b/common/protofilter/filter.go index dbecfe176..d83c0942f 100644 --- a/common/protofilter/filter.go +++ b/common/protofilter/filter.go @@ -55,9 +55,12 @@ func filterMessage(ctx context.Context, message protoreflect.Message) error { if v2extension.ConvertTimeParseIp != "" { ipValue := net.ParseIP(value.String()) target := message.Descriptor().Fields().ByTextName(v2extension.ConvertTimeParseIp) + if ipValue.To4() != nil { + ipValue = ipValue.To4() + } pendingWriteQueue = append(pendingWriteQueue, pendingWrite{ field: target, - value: protoreflect.ValueOf(ipValue), + value: protoreflect.ValueOf([]byte(ipValue)), }) } }